Filter hook 'theme_action_links'

in WP Core File wp-admin/includes/class-wp-ms-themes-list-table.php at line 672

View Source

theme_action_links

Filter Hook
Description
Filters the action links displayed for each theme in the Multisite themes list table. 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', and 'Delete'. The default action links for the Site themes list table include 'Enable', and 'Disable'.

Hook Information

File Location wp-admin/includes/class-wp-ms-themes-list-table.php View on GitHub
Hook Type Filter
Line Number 672

Hook Parameters

Type Name Description
string[] $actions An array of action links.
WP_Theme $theme The current WP_Theme object.
string $context Status of the theme, one of 'all', 'enabled', or 'disabled'.

Usage Examples

Basic Usage
<?php
// Hook into theme_action_links
add_filter('theme_action_links', 'my_custom_filter', 10, 3);

function my_custom_filter($actions, $theme, $context) {
    // Your custom filtering logic here
    return $actions;
}

Source Code Context

wp-admin/includes/class-wp-ms-themes-list-table.php:672 - How this hook is used in WordPress core
<?php
 667  		 *
 668  		 * @param string[] $actions An array of action links.
 669  		 * @param WP_Theme $theme   The current WP_Theme object.
 670  		 * @param string   $context Status of the theme, one of 'all', 'enabled', or 'disabled'.
 671  		 */
 672  		$actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme, $context );
 673  
 674  		/**
 675  		 * Filters the action links of a specific theme in the Multisite themes
 676  		 * list table.
 677  		 *

PHP Documentation

<?php
/**
		 * Filters the action links displayed for each theme in the Multisite
		 * themes list table.
		 *
		 * 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', and 'Delete'.
		 *
		 * The default action links for the Site themes list table include
		 * 'Enable', and 'Disable'.
		 *
		 * @since 2.8.0
		 *
		 * @param string[] $actions An array of action links.
		 * @param WP_Theme $theme   The current WP_Theme object.
		 * @param string   $context Status of the theme, one of 'all', 'enabled', or 'disabled'.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-admin/includes/class-wp-ms-themes-list-table.php
Related Hooks

Related hooks will be displayed here in future updates.