wp_get_mu_plugins() WP 3.0.0
Retrieve an array of must-use plugin files.
The default directory is wp-content/mu-plugins. To change the default directory manually, define WPMU_PLUGIN_DIR and WPMU_PLUGIN_URL in wp-config.php.
Хуков нет.
Возвращает
Строку[]. Array of absolute paths of files to include.
Использование
wp_get_mu_plugins();
Список изменений
С версии 3.0.0 | Введена. |
Код wp_get_mu_plugins() wp get mu plugins WP 5.6
function wp_get_mu_plugins() {
$mu_plugins = array();
if ( ! is_dir( WPMU_PLUGIN_DIR ) ) {
return $mu_plugins;
}
$dh = opendir( WPMU_PLUGIN_DIR );
if ( ! $dh ) {
return $mu_plugins;
}
while ( ( $plugin = readdir( $dh ) ) !== false ) {
if ( '.php' === substr( $plugin, -4 ) ) {
$mu_plugins[] = WPMU_PLUGIN_DIR . '/' . $plugin;
}
}
closedir( $dh );
sort( $mu_plugins );
return $mu_plugins;
}