Skip to content

Instantly share code, notes, and snippets.

@mymizan
Last active October 5, 2020 15:38
Show Gist options
  • Save mymizan/79367922b69ec6f54bae10162d8452d7 to your computer and use it in GitHub Desktop.
Save mymizan/79367922b69ec6f54bae10162d8452d7 to your computer and use it in GitHub Desktop.
<?php
/**
* change 3,4,5 with your own site IDs where you don't want to sync stock. Each ID
* should be seperated by a comma.
*/
$site_ids = array( 3, 4, 5);
/**
* Do not edit anything below.
**/
$all_sites = get_sites();
foreach( $all_sites as $site ) {
if ( in_array( $site->blog_id, $all_sites) {
add_filter('WOO_MSTORE_SYNC/settings/is_stock_sync', '__return_false');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment