get_column_headers

The timeline below displays how wordpress function get_column_headers has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.8

/**
 * WordPress Administration Screen API.
 *
 * @package WordPress
 * @subpackage Administration
 */
/**
 * Get the column headers for a screen
 *
 * @since 2.7.0
 *
 * @param string|WP_Screen $screen The screen you want the headers for
 * @return string[] The column header labels keyed by column 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];
}

WordPress Version: 5.5

/**
 * WordPress Administration Screen API.
 *
 * @package WordPress
 * @subpackage Administration
 */
/**
 * Get the column headers for a screen
 *
 * @since 2.7.0
 *
 * @param string|WP_Screen $screen The screen you want the headers for
 * @return string[] The column header labels keyed by column ID.
 */
function get_column_headers($screen)
{
    if (is_string($screen)) {
        $screen = convert_to_screen($screen);
    }
    static $column_headers = array();
    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];
}

WordPress Version: 5.4

/**
 * WordPress Administration Screen API.
 *
 * @package WordPress
 * @subpackage Administration
 */
/**
 * Get the column headers for a screen
 *
 * @since 2.7.0
 *
 * @staticvar array $column_headers
 *
 * @param string|WP_Screen $screen The screen you want the headers for
 * @return string[] The column header labels keyed by column ID.
 */
function get_column_headers($screen)
{
    if (is_string($screen)) {
        $screen = convert_to_screen($screen);
    }
    static $column_headers = array();
    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];
}

WordPress Version: 4.6

/**
 * WordPress Administration Screen API.
 *
 * @package WordPress
 * @subpackage Administration
 */
/**
 * Get the column headers for a screen
 *
 * @since 2.7.0
 *
 * @staticvar array $column_headers
 *
 * @param string|WP_Screen $screen The screen you want the headers for
 * @return array Containing the headers in the format id => UI String
 */
function get_column_headers($screen)
{
    if (is_string($screen)) {
        $screen = convert_to_screen($screen);
    }
    static $column_headers = array();
    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 array $columns An array of column headers. Default empty.
         */
        $column_headers[$screen->id] = apply_filters("manage_{$screen->id}_columns", array());
    }
    return $column_headers[$screen->id];
}

WordPress Version: 4.3

/**
 * WordPress Administration Screen API.
 *
 * @package WordPress
 * @subpackage Administration
 */
/**
 * Get the column headers for a screen
 *
 * @since 2.7.0
 *
 * @staticvar array $column_headers
 *
 * @param string|WP_Screen $screen The screen you want the headers for
 * @return array Containing the headers in the format id => UI String
 */
function get_column_headers($screen)
{
    if (is_string($screen)) {
        $screen = convert_to_screen($screen);
    }
    static $column_headers = array();
    if (!isset($column_headers[$screen->id])) {
        /**
         * Filter 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 array $columns An array of column headers. Default empty.
         */
        $column_headers[$screen->id] = apply_filters("manage_{$screen->id}_columns", array());
    }
    return $column_headers[$screen->id];
}

WordPress Version: 4.1

/**
 * WordPress Administration Screen API.
 *
 * @package WordPress
 * @subpackage Administration
 */
/**
 * Get the column headers for a screen
 *
 * @since 2.7.0
 *
 * @param string|WP_Screen $screen The screen you want the headers for
 * @return array Containing the headers in the format id => UI String
 */
function get_column_headers($screen)
{
    if (is_string($screen)) {
        $screen = convert_to_screen($screen);
    }
    static $column_headers = array();
    if (!isset($column_headers[$screen->id])) {
        /**
         * Filter 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 array $columns An array of column headers. Default empty.
         */
        $column_headers[$screen->id] = apply_filters("manage_{$screen->id}_columns", array());
    }
    return $column_headers[$screen->id];
}

WordPress Version: 4.0

/**
 * WordPress Administration Screen API.
 *
 * @package WordPress
 * @subpackage Administration
 */
/**
 * Get the column headers for a screen
 *
 * @since 2.7.0
 *
 * @param string|WP_Screen $screen The screen you want the headers for
 * @return array Containing the headers in the format id => UI String
 */
function get_column_headers($screen)
{
    if (is_string($screen)) {
        $screen = convert_to_screen($screen);
    }
    static $column_headers = array();
    if (!isset($column_headers[$screen->id])) {
        /**
         * Filter 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 array $columns An array of column headers. Default empty.
         */
        $column_headers[$screen->id] = apply_filters("manage_{$screen->id}_columns", array());
    }
    return $column_headers[$screen->id];
}

WordPress Version: 3.9

/**
 * WordPress Administration Screen API.
 *
 * @package WordPress
 * @subpackage Administration
 */
/**
 * Get the column headers for a screen
 *
 * @since 2.7.0
 *
 * @param string|WP_Screen $screen The screen you want the headers for
 * @return array Containing the headers in the format id => UI String
 */
function get_column_headers($screen)
{
    if (is_string($screen)) {
        $screen = convert_to_screen($screen);
    }
    static $column_headers = array();
    if (!isset($column_headers[$screen->id])) {
        /**
         * Filter 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 array $columns An array of column headers. Default empty.
         */
        $column_headers[$screen->id] = apply_filters('manage_' . $screen->id . '_columns', array());
    }
    return $column_headers[$screen->id];
}

WordPress Version: 3.7

/**
 * WordPress Administration Screen API.
 *
 * @package WordPress
 * @subpackage Administration
 */
/**
 * Get the column headers for a screen
 *
 * @since 2.7.0
 *
 * @param string|WP_Screen $screen The screen you want the headers for
 * @return array Containing the headers in the format id => UI String
 */
function get_column_headers($screen)
{
    if (is_string($screen)) {
        $screen = convert_to_screen($screen);
    }
    static $column_headers = array();
    if (!isset($column_headers[$screen->id])) {
        $column_headers[$screen->id] = apply_filters('manage_' . $screen->id . '_columns', array());
    }
    return $column_headers[$screen->id];
}