This documentation is deprecated since Admin Columns version 4.
Please view the updated version of this documentation here.

cac/headings/label can be used to filter the stored column headers label for use in a WP_List_Table.

Usage

Easy way to change the label on stored column. Has 4 properties you can use to identify the column. Only works on stored columns, if not stored please use native WP filters below.

/**
 * Modify the column headers
 *
 * @since 2.0
 * @param string $label Label
 * @param string $column_name Column name
 * @param array $options Column options
 * @param CPAC_Storage_Model $storage_model Storage model class instance
 */
function my_cac_headings_label( $label, $column_name, $options, $storage_model ) {

    // Possibly modify $label

    return $label;
}
add_filter( 'cac/headings/label', 'my_cac_headings_label', 10, 4 );

Example

Change the title into a star icon.

/**
 * Example: change the stored heading label 'Title' of the column into a star icon.
 *
 */
function my_cac_change_title_heading_into_star_icon( $label, $column_name, $options, $storage_model ) {

    if ( 'title' == $column_name ) {
        $label = '<span class="dashicons dashicons-star-filled"></span>';
    }

    return $label;
}
add_filter( 'cac/headings/label', 'my_cac_change_title_heading_into_star_icon', 10, 4 );

Native WordPress Filters

Here is an example that works with the WordPress native filters. The priority needs to be above 100 to overrule the Admin Columns filters.

/**
 * Example: change the heading label 'Title' of the column into a star icon
 *
 * Codex: http://codex.wordpress.org/Plugin_API/Filter_Reference/manage_pages_columns
 * Codex: http://codex.wordpress.org/Plugin_API/Action_Reference/manage_posts_custom_column
 * Codex: http://codex.wordpress.org/Plugin_API/Filter_Reference/manage_users_columns
 */
function my_manage_columns( $headings ) {

    if ( isset( $headings['title'] ) ) {
        $headings['title'] = '<span class="dashicons dashicons-star-filled"></span>';
    }

    return $headings;
}
add_filter( "manage_pages_columns", 'my_manage_columns', 101, 1 ); // Pages
add_filter( "manage_posts_columns", 'my_manage_columns', 101, 1 ); // Posttypes
add_filter( "manage_edit-post_columns", 'my_manage_columns', 101, 1 ); // Postttpes, located in get_column_headers()
add_filter( "manage_upload_columns", 'my_manage_columns', 101, 1 ); // Media, located in get_column_headers()
add_filter( "manage_users_columns", 'my_manage_columns', 101, 1 ); // Users
add_filter( "manage_edit-comments_columns", 'my_manage_columns', 101, 1 ); // Coments, located in get_column_headers()