register_column_headers() WordPress Function

The register_column_headers() function is used to register custom column headers for a particular Wordpress post type. This function is typically called within the register_post_type() function. The first argument is the name of the post type for which you are registering the custom column headers. The second argument is an array of custom column headers, where the key is the header name and the value is the header label.

register_column_headers( string $screen, string[] $columns ) #

Register column headers for a particular screen.


Description

Top ↑

See also


Top ↑

Parameters

$screen

(string)(Required)The handle for the screen to register column headers for. This is usually the hook name returned by the add_*_page() functions.

$columns

(string[])(Required)An array of columns with column IDs as the keys and translated column names as the values.


Top ↑

Source

File: wp-admin/includes/list-table.php

function register_column_headers( $screen, $columns ) {
	new _WP_List_Table_Compat( $screen, $columns );
}


Top ↑

Changelog

Changelog
VersionDescription
2.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.