bbp_filter_column_headers( array $columns = array() )

Show icons in list-table column headers instead of strings


Description Description


Parameters Parameters

$columns

(Optional) Column headers fed into list-table objects

Default value: array()


Top ↑

Return Return

(array) Possibly altered column headers


Top ↑

Source Source

File: includes/admin/actions.php

function bbp_filter_column_headers( $columns = array() ) {

	// Do not filter column headers by default - maybe we'll turn it on later
	if ( ! apply_filters( 'bbp_filter_column_headers', false ) ) {
		return $columns;
	}

	/** Forums ****************************************************************/

	// Forum topic count
	if ( isset( $columns[ 'bbp_forum_topic_count' ] ) ) {
		$columns[ 'bbp_forum_topic_count' ] = '<span class="vers bbp_topics_column"  title="' . esc_attr__( 'Topics', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Topics', 'bbpress' ) . '</span></span>';
	}

	// Forum reply count
	if ( isset( $columns[ 'bbp_forum_reply_count' ] ) ) {
		$columns[ 'bbp_forum_reply_count' ] = '<span class="vers bbp_replies_column"  title="' . esc_attr__( 'Replies', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Replies', 'bbpress' ) . '</span></span>';
	}

	/** Topics ****************************************************************/

	// Topic forum
	if ( isset( $columns[ 'bbp_topic_forum' ] ) ) {
		$columns[ 'bbp_topic_forum' ] = '<span class="vers bbp_forums_column"  title="' . esc_attr__( 'Forum', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Forum', 'bbpress' ) . '</span></span>';
	}

	// Topic reply count
	if ( isset( $columns[ 'bbp_topic_reply_count' ] ) ) {
		$columns[ 'bbp_topic_reply_count' ] = '<span class="vers bbp_replies_column"  title="' . esc_attr__( 'Replies', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Replies', 'bbpress' ) . '</span></span>';
	}

	/** Replies ***************************************************************/

	// Reply forum
	if ( isset( $columns[ 'bbp_reply_forum' ] ) ) {
		$columns[ 'bbp_reply_forum' ] = '<span class="vers bbp_forums_column"  title="' . esc_attr__( 'Forum', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Forum', 'bbpress' ) . '</span></span>';
	}

	// Reply topic
	if ( isset( $columns[ 'bbp_reply_topic' ] ) ) {
		$columns[ 'bbp_reply_topic' ] = '<span class="vers bbp_topics_column"  title="' . esc_attr__( 'Topic', 'bbpress' ) . '"><span class="screen-reader-text">' . esc_html__( 'Topic', 'bbpress' ) . '</span></span>';
	}

	return $columns;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.