Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudanti.
Follow Me
woogc/get_gc_sites – WooCommerce MultiSite Global Cart
documentation-template-default,single,single-documentation,postid-15660,theme-awake,eltd-core-1.1,woocommerce-no-js,awake child-child-ver-1.0.0,awake-ver-1.0,eltd-smooth-scroll,eltd-smooth-page-transitions,eltd-mimic-ajax,eltd-grid-1200,eltd-blog-installed,eltd-default-style,eltd-fade-push-text-top,eltd-header-standard,eltd-sticky-header-on-scroll-down-up,eltd-default-mobile-header,eltd-sticky-up-mobile-header,eltd-menu-item-first-level-bg-color,eltd-dropdown-slide-from-top,eltd-,eltd-fullscreen-search eltd-search-fade,eltd-side-menu-slide-from-right,cookies-not-set,wpb-js-composer js-comp-ver-6.3.0,vc_responsive


WooCommerce MultiSite Global Cart / woogc/get_gc_sites
Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrPin on PinterestEmail this to someonePrint this page


Name: woogc/get_gc_sites
Type: Filter
Arguments: $sites, $context

The filter can be used to exclude specific shops when WooGlobalCart core calls the internal get_gc_sites() method.
For example, a shop can be excluded from the reports.

The following code, removes shop ID’s 2 from the reporting engine:

    add_filter('woogc/get_gc_sites', '__WooGC_get_gc_sites', 10, 2);
    function __WooGC_get_gc_sites( $sites, $context )
            if ( $context   !=  'global_reports' )
                return $sites;
            //exclude site ID 2
            foreach ( $sites    as  $key    =>  $site_data )
                    if ( $site_data->blog_id    ==  "2" )
                        unset ( $sites[$key] );
            $sites  =   array_values( $sites );
            return $sites;   

The code should be placed inside a php file on wp-content/mu-plugins folder.