woogc/get_gc_sites
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] );
}
//reindex
$sites = array_values( $sites );
return $sites;
}
The code should be placed inside a php file on wp-content/mu-plugins folder.
Related Posts
Name: woogc/global_cart/sites
Type: Filter
Arguments: (array) $sites_ids
The...
Name: woogc/single_checkout/split_order/order_created
Type: Action
Arguments: $new_order
The `woogc/single_checkout/split_order/order_created` action...
The WordPress WooCommerce Global...
By default, on Product...
Name: woogc/ps/synchronize_product/child_product
Type: Filter
Arguments:
(object)$child_product
(array)$main_product_data
(int)$origin_product_blog_ID
This filter...
The WooCommerce Global Cart...
Name: woogc/ps/interfaces/sync_to_shop
Type: Filter
Arguments: $status, $remote_blog_id, $post
The...
Name: woogc/ps/synchronize_product/completed
Type: Filter
Arguments: $child_product_ID, $main_product_ID,...
Name: woogc/ps/interfaces/synchronize_to_sites
Type: Filter
Arguments: $sites
The filter...