関数 wp_get_mu_plugins()
2014/11/22
プラグインの場所・実態を配列で返す関数を定義
定義ファイル :/blog/wp-includes/load.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | function wp_get_mu_plugins() { $mu_plugins = array(); if ( !is_dir( WPMU_PLUGIN_DIR ) ) return $mu_plugins; if ( ! $dh = opendir( WPMU_PLUGIN_DIR ) ) return $mu_plugins; while ( ( $plugin = readdir( $dh ) ) !== false ) { if ( substr( $plugin, -4 ) == '.php' ) $mu_plugins[] = WPMU_PLUGIN_DIR . '/' . $plugin; } closedir( $dh ); sort( $mu_plugins ); return $mu_plugins; } |