Using WordPress ‘mu_activity_box_end’ PHP action

The mu_activity_box_end WordPress PHP action fires at the end of the ‘Right Now’ widget in the Network Admin dashboard.

Usage

add_action('mu_activity_box_end', 'my_custom_code');
function my_custom_code() {
// Your custom code here
}

Parameters

  • None

More information

See WordPress Developer Resources: mu_activity_box_end

Examples

Add a custom message

Add a custom message at the end of the ‘Right Now’ widget.

add_action('mu_activity_box_end', 'add_custom_message');
function add_custom_message() {
echo '<p><strong>Custom message:</strong> Have a great day!</p>';
}

Display the total number of users

Display the total number of users in the network.

add_action('mu_activity_box_end', 'display_total_users');
function display_total_users() {
    $user_count = get_user_count();
    echo "<p><strong>Total Users:</strong> {$user_count}</p>";
}

Show the total number of active plugins

Show the total number of active plugins in the network.

add_action('mu_activity_box_end', 'display_active_plugins');
function display_active_plugins() {
    $plugins = get_site_option('active_sitewide_plugins');
    $plugin_count = count($plugins);
    echo "<p><strong>Active Plugins:</strong> {$plugin_count}</p>";
}

Display the total number of themes

Display the total number of installed themes in the network.

add_action('mu_activity_box_end', 'display_total_themes');
function display_total_themes() {
    $themes = wp_get_themes();
    $theme_count = count($themes);
    echo "<p><strong>Total Themes:</strong> {$theme_count}</p>";
}

Add a link to the network settings page at the end of the ‘Right Now’ widget.

add_action('mu_activity_box_end', 'add_network_settings_link');
function add_network_settings_link() {
    $url = network_admin_url('settings.php');
    echo "<p><a href='{$url}'>Go to Network Settings</a></p>";
}