manage_sites_action_links

Filters the action links displayed for each site in the Sites list table.

Description

apply_filters( 'manage_sites_action_links', (array) $array, (int) $blog_blog_id, (string) $blogname ); 

The Edit,, Dashboard , Delete, and Visit links are displayed by default for each site. The site's status determines whether to show the 'Activate' or Deactivate link, Unarchive or Archive links, and 'Not Spam' or Spam link for each site.

Parameters (3)

0. $array (array) => array_filter( $actions )
An array of action links to be displayed.
1. $blog_blog_id (int)
The blog blog id.
2. $blogname (string)
Site path, formatted depending on whether it is a sub-domain or subdirectory multisite install.

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'manage_sites_action_links', $array, $blog_blog_id, $blogname ); 
  2.  
  3. if ( !empty( $array ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the manage_sites_action_links callback 
  2. function filter_manage_sites_action_links( $array, $blog_blog_id, $blogname ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'manage_sites_action_links', 'filter_manage_sites_action_links', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'manage_sites_action_links', 'filter_manage_sites_action_links', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-admin/includes/class-wp-ms-sites-list-table.php  
  1. $actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );