wp_get_theme_error() WordPress Function

The wp_get_theme_error() function is used to get the error message for a failed theme update.

wp_get_theme_error( string $theme ) #

Gets the error that was recorded for a paused theme.


Parameters

$theme

(string)(Required)Path to the theme directory relative to the themes directory.


Top ↑

Return

(array|false) Array of error information as it was returned by error_get_last(), or false if none was recorded.


Top ↑

Source

File: wp-admin/includes/theme.php

function wp_get_theme_error( $theme ) {
	if ( ! isset( $GLOBALS['_paused_themes'] ) ) {
		return false;
	}

	if ( ! array_key_exists( $theme, $GLOBALS['_paused_themes'] ) ) {
		return false;
	}

	return $GLOBALS['_paused_themes'][ $theme ];
}

Top ↑

Changelog

Changelog
VersionDescription
5.2.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.