WC_Tracks::get_blog_detailspublic staticWC 1.0

Gather blog related properties.

Метод класса: WC_Tracks{}

Хуков нет.

Возвращает

Массив. Blog details.

Использование

$result = WC_Tracks::get_blog_details( $user_id );
$user_id(int) (обязательный)
User id.

Код WC_Tracks::get_blog_details() WC 9.9.4

public static function get_blog_details( $user_id ) {
	$blog_details = get_transient( 'wc_tracks_blog_details' );
	if ( false === $blog_details ) {
		// Ensure the store ID is set.
		if ( ! class_exists( '\WC_Install' ) ) {
			include_once WC_ABSPATH . 'includes/class-wc-install.php';
		}
		\WC_Install::maybe_set_store_id();

		$blog_details = array(
			'url'            => home_url(),
			'blog_lang'      => get_user_locale( $user_id ),
			'blog_id'        => class_exists( 'Jetpack_Options' ) ? Jetpack_Options::get_option( 'id' ) : null,
			'store_id'       => get_option( \WC_Install::STORE_ID_OPTION, null ),
			'products_count' => self::get_products_count(),
			'wc_version'     => WC()->version,
		);
		set_transient( 'wc_tracks_blog_details', $blog_details, DAY_IN_SECONDS );
	}
	return $blog_details;
}