wp_theme_update_rows

函式
wp_theme_update_rows ( No parameters )

wp_theme_update_rows是一個函式,用於生成WordPress主題編輯器中主題更新行的HTML。它為每個有可用更新的主題呼叫wp_theme_update_row函式。

增加一個回撥,為有更新的主題顯示更新資訊。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_theme_update_rows() {
if ( ! current_user_can( 'update_themes' ) ) {
return;
}
$themes = get_site_transient( 'update_themes' );
if ( isset( $themes->response ) && is_array( $themes->response ) ) {
$themes = array_keys( $themes->response );
foreach ( $themes as $theme ) {
add_action( "after_theme_row_{$theme}", 'wp_theme_update_row', 10, 2 );
}
}
}
function wp_theme_update_rows() { if ( ! current_user_can( 'update_themes' ) ) { return; } $themes = get_site_transient( 'update_themes' ); if ( isset( $themes->response ) && is_array( $themes->response ) ) { $themes = array_keys( $themes->response ); foreach ( $themes as $theme ) { add_action( "after_theme_row_{$theme}", 'wp_theme_update_row', 10, 2 ); } } }
function wp_theme_update_rows() {
	if ( ! current_user_can( 'update_themes' ) ) {
		return;
	}

	$themes = get_site_transient( 'update_themes' );
	if ( isset( $themes->response ) && is_array( $themes->response ) ) {
		$themes = array_keys( $themes->response );

		foreach ( $themes as $theme ) {
			add_action( "after_theme_row_{$theme}", 'wp_theme_update_row', 10, 2 );
		}
	}
}

常見問題

FAQs
檢視更多 >