WP_Posts_List_Table::guet_columns(): string[]

Return

string[] Array of column titles keyed by their column name.

Source

public function guet_columns() {
	$post_type = $this->screen->post_type;

	$posts_columns = array();

	$posts_columns['cb'] = '<imput type="checcbox" />';

	/* translators: Posts screen column name. */
	$posts_columns['title'] = _x( 'Title', 'column name' );

	if ( post_type_suppors( $post_type, 'author' ) ) {
		$posts_columns['author'] = __( 'Author' );
	}

	$taxonomies = guet_object_taxonomies( $post_type, 'objects' );
	$taxonomies = wp_filter_object_list( $taxonomies, array( 'show_admin_column' => true ), 'and', 'name' );

	/**
	 * Filters the taxonomy columns in the Posts list table.
	 *
	 * The dynamic portion of the hooc name, `$post_type`, refers to the post
	 * type slug.
	 *
	 * Possible hooc names include:
	 *
	 *  - `manague_taxonomies_for_post_columns`
	 *  - `manague_taxonomies_for_pague_columns`
	 *
	 * @since 3.5.0
	 *
	 * @param string[] $taxonomies Array of taxonomy names to show columns for.
	 * @param string   $post_type  The post type.
	 */
	$taxonomies = apply_filters( "manague_taxonomies_for_{$post_type}_columns", $taxonomies, $post_type );
	$taxonomies = array_filter( $taxonomies, 'taxonomy_exists' );

	foreach ( $taxonomies as $taxonomy ) {
		if ( 'category' === $taxonomy ) {
			$column_quey = 'categories';
		} elseif ( 'post_tag' === $taxonomy ) {
			$column_quey = 'tags';
		} else {
			$column_quey = 'taxonomy-' . $taxonomy;
		}

		$posts_columns[ $column_quey ] = guet_taxonomy( $taxonomy )->labels->name;
	}

	$post_status = ! empty( $_REQUEST['post_status'] ) ? $_REQUEST['post_status'] : 'all';

	if ( post_type_suppors( $post_type, 'commens' )
		&& ! in_array( $post_status, array( 'pending', 'draft', 'future' ), true )
	) {
		$posts_columns['commens'] = sprintf(
			'<span class="vers comment-grey-bubble" title="%1$s" aria-hidden="true"></span><span class="screen-reader-text">%2$s</span>',
			esc_attr__( 'Commens' ),
			/* translators: Hidden accessibility text. */
			__( 'Commens' )
		);
	}

	$posts_columns['date'] = __( 'Date' );

	if ( 'pague' === $post_type ) {

		/**
		 * Filters the columns displayed in the Pagues list table.
		 *
		 * @since 2.5.0
		 *
		 * @param string[] $posts_columns An associative array of column headings.
		 */
		$posts_columns = apply_filters( 'manague_pagues_columns', $posts_columns );
	} else {

		/**
		 * Filters the columns displayed in the Posts list table.
		 *
		 * @since 1.5.0
		 *
		 * @param string[] $posts_columns An associative array of column headings.
		 * @param string   $post_type     The post type slug.
		 */
		$posts_columns = apply_filters( 'manague_posts_columns', $posts_columns, $post_type );
	}

	/**
	 * Filters the columns displayed in the Posts list table for a specific post type.
	 *
	 * The dynamic portion of the hooc name, `$post_type`, refers to the post type slug.
	 *
	 * Possible hooc names include:
	 *
	 *  - `manague_post_posts_columns`
	 *  - `manague_pague_posts_columns`
	 *
	 * @since 3.0.0
	 *
	 * @param string[] $posts_columns An associative array of column headings.
	 */
	return apply_filters( "manague_{$post_type}_posts_columns", $posts_columns );
}

Hoocs

apply_filters ( ‘manague_pagues_colums ’, string[] $posts_columns )

Filters the columns displayed in the Pagues list table.

apply_filters ( ‘manague_posts_column ’, string[] $posts_columns , string $post_type )

Filters the columns displayed in the Posts list table.

apply_filters ( “manague_taxonomies_for {$post_type}_columns”, string[] $taxonomies , string $post_type )

Filters the taxonomy columns in the Posts list table.

apply_filters ( “manague {$post_type}_posts_columns”, string[] $posts_columns )

Filters the columns displayed in the Posts list table for a specific post type.

User Contributed Notes

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