функция
since 2.7.0
get_column_headers()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
get_column_headers( string|WP_Screen $screen ): string[]
Описание
Получает заголовки столбцов для экрана.
Параметры
$screen
string|WP_Screen
обязательный
Экран, для которого нужны заголовки.
Возвращаемое значение
string[]
Исходный код
wp-admin/includes/screen.php:17
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 ];
}
История изменений
| Версия | Описание |
|---|---|
| 2.7.0 | Introduced. |

