Created
April 3, 2023 05:52
-
-
Save theRealRizeo/b87835f55b105cb76cf856352bb545b4 to your computer and use it in GitHub Desktop.
Filter sites from NS cloner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter out sites to show in cloning list. | |
*/ | |
add_filter( 'ns_cloner_sites_list', function( $sites ) { | |
$my_site_ids = array( 1, 10, 3, 8, 13 ); // The site ids you only want to show. Replace with the ids of your sites. | |
foreach ( $sites as $id => $name ) { | |
if ( ! in_array( $id, $my_site_ids, true ) ) { | |
unset( $sites[ $id ] ); | |
} | |
} | |
return $sites; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment