Automattic\WooCommerce\Blocks\AI
Connection::get_site_id()
Return the site ID.
Метод класса: Connection{}
Хуков нет.
Возвращает
Int|\WP_Error
. The site ID or a WP_Error object.
Использование
$Connection = new Connection(); $Connection->get_site_id();
Код Connection::get_site_id() Connection::get site id WC 9.4.2
public function get_site_id() { if ( ! class_exists( Jetpack_Options::class ) ) { return new \WP_Error( 'site-id-error', esc_html__( 'Failed to fetch the site ID: try again later.', 'woocommerce' ) ); } $site_id = Jetpack_Options::get_option( 'id' ); if ( ! $site_id ) { return new \WP_Error( 'site-id-error', esc_html__( 'Failed to fetch the site ID: The site is not registered.', 'woocommerce' ) ); } return $site_id; }