Title: wp_get_theme_error
Published: May 7, 2019
Last modified: February 24, 2026

---

# wp_get_theme_error( string $theme ): array|false

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/wp_get_theme_error/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_get_theme_error/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_get_theme_error/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_get_theme_error/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_get_theme_error/?output_format=md#wp--skip-link--target)

Gets the error that was recorded for a paused theme.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_get_theme_error/?output_format=md#parameters)󠁿

 `$theme`stringrequired

Path to the theme directory relative to the themes directory.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_get_theme_error/?output_format=md#return)󠁿

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

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_get_theme_error/?output_format=md#source)󠁿

    ```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 ];
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/theme.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/theme.php#L1141)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/theme.php#L1141-L1151)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_get_theme_error/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme_error%2F)
before being able to contribute a note or feedback.