You appear to be a bot. Output may be restricted
Description
Activate / deactivate MU library processingEither copies an MU plugin from the source to the target or removes the MU plugin file from the target Note: WPMU_PLUGIN_DIR may not have been defined if we're invoked from wp-config.php, but ABSPATH should have been. MU plugin files are loaded in ascending alphabetical order. For MU plugin for oik-bwtrace is prefixed with an underscore so that it's loaded very early. The MU plugin for oik-lib is prefixed with two underscores so that it's loaded before oik-bwtrace
Usage
oik_lib_activate_mu( $activate, $file, $plugin, $target );
Parameters
- $activate
- ( bool ) optional default: 1 – true to activate, false to deactivate
- $file
- ( string ) optional default: includes/__oik-lib-mu.php –
- $plugin
- ( string ) optional default: oik-lib –
- $target
- ( string ) optional –
Returns
voidTO DO
Check if this is a good idea or not.Source
File name: oik-libs/libs/oik-lib-mu.phpLines:
1 to 33 of 33
function oik_lib_activate_mu( $activate=true, $file="includes/__oik-lib-mu.php", $plugin="oik-lib", $target=null ) { //bw_trace2(); $source = oik_path( $file, $plugin ); if ( defined( 'WPMU_PLUGIN_DIR' ) ) { $mu_target = WPMU_PLUGIN_DIR; } else { $mu_target = ABSPATH . '/wp-content/mu-plugins'; } //bw_trace2( $mu_target, "target dir" ); if ( is_dir( $mu_target ) ) { $mu_target .= '/'; if ( $target ) { $mu_target .= $target; } else { $mu_target .= basename( $file ); } //bw_trace2( $mu_target, "target file:$activate" ); if ( $activate ) { if ( !file_exists( $mu_target ) ) { copy( $source, $mu_target ); } } else { if ( file_exists( $mu_target ) ) { unlink( $mu_target ); } } } else { // Do we need to make this ourselves? bw_trace2( "Not a dir?" ); //gobang(); } }View on GitHub