theme_action_links_<stylesheet>

Filters the action links of a specific theme in the Multisite themes list table.

Description

apply_filters( 'theme_action_links_<stylesheet>', (array) $actions, (WP_Theme) $theme, (string) $context ); 

The dynamic portion(s) of the hook name refer to the directory name of the theme, which in most cases is synonymous with the template name.

Parameters (3)

0. $actions (array)
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. $actions = apply_filters( 'theme_action_links_{$stylesheet}', $actions, $theme, $context ); 
  2.  
  3. if ( !empty( $actions ) ) { 
  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_<stylesheet> callback 
  2. function filter_theme_action_links_stylesheet( $actions, $theme, $context ) { 
  3. // make filter magic happen here... 
  4. return $actions
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( "theme_action_links_{$stylesheet}", 'filter_theme_action_links_stylesheet', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( "theme_action_links_{$stylesheet}", 'filter_theme_action_links_stylesheet', 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_{$stylesheet}", $actions, $theme, $context ); 
/wp-admin/includes/class-wp-themes-list-table.php  
  1. $actions = apply_filters( "theme_action_links_$stylesheet", $actions, $theme );