get_column_headers

函式
get_column_headers ( $screen )
引數
  • (string|WP_Screen) $screen The screen you want the headers for
    Required:
返回值
  • (string[]) The column header labels keyed by column ID.
定義位置
相關方法
print_column_headersregister_column_headersget_custom_headerget_headerget_cli_args
引入
2.7.0
棄用
-

get_column_headers: 這個函式為WordPress管理區的文章或頁面列表表返回一個列標題陣列。

獲取一個螢幕的列標題。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_column_headers( $screen ) {
static $column_headers = array();
if ( is_string( $screen ) ) {
$screen = convert_to_screen( $screen );
}
if ( ! isset( $column_headers[ $screen->id ] ) ) {
/**
* Filters the column headers for a list table on a specific screen.
*
* The dynamic portion of the hook name, `$screen->id`, refers to the
* ID of a specific screen. For example, the screen ID for the Posts
* list table is edit-post, so the filter for that screen would be
* manage_edit-post_columns.
*
* @since 3.0.0
*
* @param string[] $columns The column header labels keyed by column ID.
*/
$column_headers[ $screen->id ] = apply_filters( "manage_{$screen->id}_columns", array() );
}
return $column_headers[ $screen->id ];
}
function get_column_headers( $screen ) { static $column_headers = array(); if ( is_string( $screen ) ) { $screen = convert_to_screen( $screen ); } if ( ! isset( $column_headers[ $screen->id ] ) ) { /** * Filters the column headers for a list table on a specific screen. * * The dynamic portion of the hook name, `$screen->id`, refers to the * ID of a specific screen. For example, the screen ID for the Posts * list table is edit-post, so the filter for that screen would be * manage_edit-post_columns. * * @since 3.0.0 * * @param string[] $columns The column header labels keyed by column ID. */ $column_headers[ $screen->id ] = apply_filters( "manage_{$screen->id}_columns", array() ); } return $column_headers[ $screen->id ]; }
function get_column_headers( $screen ) {
	static $column_headers = array();

	if ( is_string( $screen ) ) {
		$screen = convert_to_screen( $screen );
	}

	if ( ! isset( $column_headers[ $screen->id ] ) ) {
		/**
		 * Filters the column headers for a list table on a specific screen.
		 *
		 * The dynamic portion of the hook name, `$screen->id`, refers to the
		 * ID of a specific screen. For example, the screen ID for the Posts
		 * list table is edit-post, so the filter for that screen would be
		 * manage_edit-post_columns.
		 *
		 * @since 3.0.0
		 *
		 * @param string[] $columns The column header labels keyed by column ID.
		 */
		$column_headers[ $screen->id ] = apply_filters( "manage_{$screen->id}_columns", array() );
	}

	return $column_headers[ $screen->id ];
}

常見問題

FAQs
檢視更多 >