WC_Tracks::get_blog_details
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() WC Tracks::get blog details code WC 10.6.2
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()->stable_version(),
);
set_transient( 'wc_tracks_blog_details', $blog_details, DAY_IN_SECONDS );
}
return $blog_details;
}