get_broken_themes

函式
get_broken_themes ( No parameters )
返回值
  • (array)
相關
  • wp_get_themes()
定義位置
相關方法
get_current_themeget_themesget_allowed_themesget_block_templatesget_block_theme_folders
引入
1.5.0
棄用
3.4.0

get_broken_themes: 這個函式檢索WordPress多站點網路中被破壞的主題列表。一個被破壞的主題是一個已經被刪除但仍被分配給一個站點的主題: 這個函式不接受任何引數,並返回一個破損主題物件的陣列。

檢索一個被破壞的主題列表。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_broken_themes() {
_deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'errors' => true )" );
$themes = wp_get_themes( array( 'errors' => true ) );
$broken = array();
foreach ( $themes as $theme ) {
$name = $theme->get('Name');
$broken[ $name ] = array(
'Name' => $name,
'Title' => $name,
'Description' => $theme->errors()->get_error_message(),
);
}
return $broken;
}
function get_broken_themes() { _deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'errors' => true )" ); $themes = wp_get_themes( array( 'errors' => true ) ); $broken = array(); foreach ( $themes as $theme ) { $name = $theme->get('Name'); $broken[ $name ] = array( 'Name' => $name, 'Title' => $name, 'Description' => $theme->errors()->get_error_message(), ); } return $broken; }
function get_broken_themes() {
	_deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'errors' => true )" );

	$themes = wp_get_themes( array( 'errors' => true ) );
	$broken = array();
	foreach ( $themes as $theme ) {
		$name = $theme->get('Name');
		$broken[ $name ] = array(
			'Name' => $name,
			'Title' => $name,
			'Description' => $theme->errors()->get_error_message(),
		);
	}
	return $broken;
}

常見問題

FAQs
檢視更多 >