WP_Posts_List_Table::column_author() WordPress Method

The WP_Posts_List_Table::column_author() method is used to display the author column in the Posts list table. This method takes a single argument, $post, which is the WP_Post object for the current row. The method first checks if the post has an author assigned. If not, it displays "Guest" in the author column. Otherwise, it fetches the author data from the database and displays the author's name in the column.

WP_Posts_List_Table::column_author( WP_Post $post ) #

Handles the post author column output.


Parameters

$post

(WP_Post)(Required)The current WP_Post object.


Top ↑

Source

File: wp-admin/includes/class-wp-posts-list-table.php

	public function column_author( $post ) {
		$args = array(
			'post_type' => $post->post_type,
			'author'    => get_the_author_meta( 'ID' ),
		);
		echo $this->get_edit_link( $args, get_the_author() );
	}


Top ↑

Changelog

Changelog
VersionDescription
4.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.