WP_Comments_List_Table::column_default() WordPress Method

The WP_Comments_List_Table::column_default() method is used to display the default column content for a particular row in the comments list table. This method is called for each row in the comments list table, and is used to generate the content for the default columns that are not handled by a specific column method. The WP_Comments_List_Table::column_default() method takes two arguments: the current comment object for the row, and the name of the column. The method first checks if a specific column method exists for the column, and if so, calls that method to generate the column content. If no specific column method exists, the method then checks if the column is one of the default columns (ID, author, author email, author IP, date, status, and so on), and if so, generates the column content for that column. If the column is not one of the default columns, the method then checks if the column is a custom column added by a plugin or theme, and if so, calls the appropriate method to generate the column content. Finally, if the column is not a default or custom column, the method returns an empty string.

WP_Comments_List_Table::column_default( WP_Comment $item, string $column_name ) #


Parameters

$item

(WP_Comment)(Required)The comment object.

$column_name

(string)(Required)The custom column's name.


Top ↑

Source

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

	public function column_default( $item, $column_name ) {
		/**
		 * Fires when the default column output is displayed for a single row.
		 *
		 * @since 2.8.0
		 *
		 * @param string $column_name The custom column's name.
		 * @param string $comment_id  The comment ID as a numeric string.
		 */
		do_action( 'manage_comments_custom_column', $column_name, $item->comment_ID );
	}


Top ↑

Changelog

Changelog
VersionDescription
5.9.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.