theme_action_links

Filters the action links displayed for each theme in the Multisite themes list table.

Description

apply_filters( 'theme_action_links', (array) $array, (WP_Theme) $theme, (string) $context ); 

The action links displayed are determined by the theme's status, and which Multisite themes list table is being displayed - the Network themes list table (themes.php), which displays all installed themes, or the Site themes list table (site-themes.php), which displays the non-network enabled themes when editing a site in the Network admin.

The default action links for the Network themes list table include 'Network Enable', Network Disable,, Edit., and Delete.

The default action links for the Site themes list table include 'Enable', Disable, and Edit..

Parameters (3)

0. $array (array) => array_filter( $actions )
An array of action links.
1. $theme (WP_Theme)
The current WP_Theme object.
2. $context (string)
Status of the theme.

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'theme_action_links', $array, $theme, $context ); 
  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 theme_action_links callback 
  2. function filter_theme_action_links( $array, $theme, $context ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'theme_action_links', 'filter_theme_action_links', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'theme_action_links', 'filter_theme_action_links', 10, 3 ); 

Defined (2)

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

/wp-admin/includes/class-wp-ms-themes-list-table.php  
  1. $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme, $context ); 
/wp-admin/includes/class-wp-themes-list-table.php  
  1. $actions = apply_filters( 'theme_action_links', $actions, $theme );