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.


Top ↑

Parameters

$actions

(array)(Required)Preview actions.


Top ↑

Return

(array)


Top ↑

Source

File: wp-admin/includes/class-theme-upgrader.php

	public function hide_activate_preview_actions( $actions ) {
		unset( $actions['activate'], $actions['preview'] );
		return $actions;
	}

Top ↑

Changelog

Changelog
VersionDescription
3.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.