Using WordPress ‘network_admin_edit_{$action}’ PHP action

The network_admin_edit_{$action} WordPress PHP action fires the requested handler action. The dynamic portion of the hook name, $action, refers to the name of the requested action derived from the GET request.

Usage

add_action('network_admin_edit_your_action_name', 'your_custom_function');
function your_custom_function() {
    // Your custom code here
}

Parameters

  • $action (string) – The dynamic portion of the hook name, which refers to the name of the requested action derived from the GET request.

More information

See WordPress Developer Resources: network_admin_edit_{$action}

Examples

Add a custom action to update a setting

In this example, we create a custom action to update a network setting when your_update_setting action is called.

add_action('network_admin_edit_your_update_setting', 'update_your_network_setting');
function update_your_network_setting() {
    // Update your network setting here
}

Add a custom action to delete a user

In this example, we create a custom action to delete a user when your_delete_user action is called.

add_action('network_admin_edit_your_delete_user', 'delete_your_user');
function delete_your_user() {
    // Delete user here
}

Add a custom action to activate a theme

In this example, we create a custom action to activate a theme when your_activate_theme action is called.

add_action('network_admin_edit_your_activate_theme', 'activate_your_theme');
function activate_your_theme() {
    // Activate theme here
}

Add a custom action to create a new site

In this example, we create a custom action to create a new site when your_create_site action is called.

add_action('network_admin_edit_your_create_site', 'create_your_site');
function create_your_site() {
    // Create new site here
}

Add a custom action to deactivate a plugin

In this example, we create a custom action to deactivate a plugin when your_deactivate_plugin action is called.

add_action('network_admin_edit_your_deactivate_plugin', 'deactivate_your_plugin');
function deactivate_your_plugin() {
    // Deactivate plugin here
}