activated_plugin

ACTION wp-admin\includes\plugin.php (ligne 730) github
Fires after a plugin has been activated. If a plugin is silently activated (such as during an update), this hook does not fire.

Paramètres

Entrée :
$plugin, $network_wide
Sortie :
@param string $plugin       Path to the plugin file relative to the plugins directory.
@param bool   $network_wide Whether to enable the plugin for all sites in the network

Utilisation

// Ajouter une fonction au hook action 'activated_plugin'
add_action('activated_plugin', 'ma_fonction_personnalisee', 10, 1);

function ma_fonction_personnalisee($plugin, $network_wide) {
    // Votre code ici
    error_log('Hook activated_plugin déclenché');
}

Actualités

Chargement des actualités...