WC_Tracks::get_blog_details()public staticWC 1.0

Gather blog related properties.

Method of the class: WC_Tracks{}

No Hooks.

Returns

Array. Blog details.

Usage

$result = WC_Tracks::get_blog_details( $user_id );
$user_id(int) (required)
User id.

WC_Tracks::get_blog_details() code WC 9.8.5

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;
}