ac/headings/label

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

Usage

Easy way to change the label on stored column. Contains an AC_Column object as param. Only works on stored columns, if not stored please use native WP filters below.

/**
 * Filter to alter the label of a column heading
 *
 * @param string $label
 * @param AC_Column $column
 */
function my_ac_column_heading_label( $label, $column ){
	// (optional) check for specific $column (type/name)
	// change $label by new value

	return $label;
}
add_filter( 'ac/headings/label', 'my_ac_column_heading_label' );

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()

Legacy

The old filter cac/headings/label is replaced by ac/headings/label since Admin Columns Pro 4.0.