activate_plugins [ WordPress Function ]
activate_plugins ( $plugins, $redirect = '', $network_wide = false, $silent = false )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: activate_plugin, deactivate_plugins, activate_sitewide_plugin, validate_active_plugins, deactivate_sitewide_plugin
Activate multiple plugins.
When WP_Error is returned, it does not mean that one of the plugins had errors. It means that one or more of the plugins file path was invalid.
The execution will be halted as soon as one of the plugins has an error.
Source
<?php
function activate_plugins( $plugins, $redirect = '', $network_wide = false, $silent = false ) {
if ( !is_array($plugins) )
$plugins = array($plugins);
$errors = array();
foreach ( $plugins as $plugin ) {
if ( !empty($redirect) )
$redirect = add_query_arg('plugin', $plugin, $redirect);
$result = activate_plugin($plugin, $redirect, $network_wide, $silent);
if ( is_wp_error($result) )
$errors[$plugin] = $result;
}
if ( !empty($errors) )
return new WP_Error('plugins_invalid', __('One of the plugins is invalid.'), $errors);
return true;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- activate_plugins WordPress capability | ShinePHP.com
Nov 26, 2011 ... Allows access to Administration Panel options: Plugins. Let's look under the WordPress hood and see on examples of WordPress 3.3 source ...
www.shinephp.com - PHPXRef 0.7 : WordPress : Function Reference: activate_plugins()
Function and Method Cross Reference. activate_plugins(). Defined at: /wp-admin /includes/plugin.php -> line 624. Referenced 1 times: /wp-admin/plugins.php ...
phpxref.ftwr.co.uk - activate_plugins() WordPress function reference, arguments and ...
activate_plugins(). Activate multiple plugins. When WP_Error is returned, it does not mean that one of the plugins had errors. It means that one or more of the ...
queryposts.com - activate_plugins | A HitchHackers guide through WordPress
Feb 11, 2011 ... function activate_plugins( $plugins, $redirect = '', $network_wide = false, $silent = false ) { if ( !is_array($plugins) ) $plugins = array($plugins); ...
hitchhackerguide.com