Home/Hooks/activate_plugin
ACTION

activate_plugin

Fires before a plugin is activated. If a plugin is silently activated (such as during an update), this hook does not fire. or just the current site. Multisite only. Default false.

wp-admin/includes/plugin.php
Line 688
2 Parameters
View Source

Usage

add_action( 'activate_plugin', 'your_callback_function', 10, 2 );

Action Callback:

function your_callback_function( $plugin, $network_wide ) {
    // Your code here
    
}

Parameters

$plugin

Parameter 1

$network_wide

Parameter 2

⚡ Action Hook

Action hooks allow you to insert custom code at specific points during WordPress execution. Actions do not return any values.