get_mu_plugins [ WordPress Function ]
get_mu_plugins ( No parameters )
| Returns: |
|
| Defined at: |
|
Check the mu-plugins directory and retrieve all mu-plugin files with any plugin data.
WordPress only includes mu-plugin files in the base mu-plugins directory (wp-content/mu-plugins).
Source
<?php
function get_mu_plugins() {
$wp_plugins = array();
// Files in wp-content/mu-plugins directory
$plugin_files = array();
if ( ! is_dir( WPMU_PLUGIN_DIR ) )
return $wp_plugins;
if ( $plugins_dir = @ opendir( WPMU_PLUGIN_DIR ) ) {
while ( ( $file = readdir( $plugins_dir ) ) !== false ) {
if ( substr( $file, -4 ) == '.php' )
$plugin_files[] = $file;
}
} else {
return $wp_plugins;
}
@closedir( $plugins_dir );
if ( empty($plugin_files) )
return $wp_plugins;
foreach ( $plugin_files as $plugin_file ) {
if ( !is_readable( WPMU_PLUGIN_DIR . "/$plugin_file" ) )
continue;
$plugin_data = get_plugin_data( WPMU_PLUGIN_DIR . "/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached.
if ( empty ( $plugin_data['Name'] ) )
$plugin_data['Name'] = $plugin_file;
$wp_plugins[ $plugin_file ] = $plugin_data;
}
if ( isset( $wp_plugins['index.php'] ) && filesize( WPMU_PLUGIN_DIR . '/index.php') <= 30 ) // silence is golden
unset( $wp_plugins['index.php'] );
uasort( $wp_plugins, '_sort_uname_callback' );
return $wp_plugins;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Docs for page plugin.php
get_mu_plugins (line 304). Check the mu-plugins directory and retrieve all mu- plugin files with any plugin data. WordPress only includes mu-plugin files in the ...
phpdoc.wordpress.org - WordPress › CDN Sync Tool « WordPress Plugins
Apr 10, 2012 ... 0.4. Added Rackspace Cloudfiles support. Fixed get_mu_plugins() not defined error. Added anti-hotlinking functionality.
wordpress.org - How do plugins get executed automatically from wp-content ...
Feb 16, 2011... looking specifically for how these plugins are loaded I opened up /wp-admin/ includes/plugin.php and found get_mu_plugins() on line 279.
wordpress.stackexchange.com - wp_get_mu_plugins() WordPress function reference, arguments and ...
Similar ...mu... get_mu_plugins() · is_multisite() · is_multi_author() · load_muplugin_textdomain() · __clear_multi_author_cache() ...
queryposts.com