Theme_Upgrader::hide_activate_preview_actions() WordPress Method
The Theme_Upgrader::hide_activate_preview_actions() method is used to hide the "Activate" and "Preview" action links for a theme when the theme is already active. This is useful for preventing users from accidentally activating or previewing a theme that is already active.
Theme_Upgrader::hide_activate_preview_actions( array $actions ) #
Don’t display the activate and preview actions to the user.
Description
Hooked to the ‘install_theme_complete_actions’ filter by Theme_Upgrader::check_parent_theme_filter() when installing a child theme and installing the parent theme fails.
Parameters
- $actions
(array)(Required)Preview actions.
Return
(array)
Source
File: wp-admin/includes/class-theme-upgrader.php
public function hide_activate_preview_actions( $actions ) { unset( $actions['activate'], $actions['preview'] ); return $actions; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |