WP_List_Table::handle_row_actions() WordPress Method

The WP_List_Table::handle_row_actions() method is used to handle the default row actions for a list table. These actions include: - view - edit - inline-edit - delete -trash The method takes two arguments: the current post and the list of actions. It then uses these arguments to iterate through the list of actions and perform the appropriate action for each one. This method is used by the WP_List_Table class to generate the default row actions for a list table. It is not meant to be used by developers directly.

WP_List_Table::handle_row_actions( object|array $item, string $column_name, string $primary ) #

Generates and display row actions links for the list table.


Parameters

$item

(object|array)(Required)The item being acted upon.

$column_name

(string)(Required)Current column name.

$primary

(string)(Required)Primary column name.


Top ↑

Return

(string) The row actions HTML, or an empty string if the current column is not the primary column.


Top ↑

Source

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

	protected function handle_row_actions( $item, $column_name, $primary ) {
		return $column_name === $primary ? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>' : '';
	}


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.