WP_Media_List_Table::handle_row_actions()protectedWP 4.3.0

Generates and displays row action links.

Method of the class: WP_Media_List_Table{}

No Hooks.

Return

String. Row actions output for media attachments, or an empty string if the current column is not the primary column.

Usage

// protected - for code of main (parent) or child class
$result = $this->handle_row_actions( $item, $column_name, $primary );
$item(WP_Post) (required)
Attachment being acted upon.
$column_name(string) (required)
Current column name.
$primary(string) (required)
Primary column name.

Changelog

Since 4.3.0 Introduced.
Since 5.9.0 Renamed $post to $item to match parent class for PHP 8 named parameter support.

WP_Media_List_Table::handle_row_actions() code WP 6.5.2

protected function handle_row_actions( $item, $column_name, $primary ) {
	if ( $primary !== $column_name ) {
		return '';
	}

	// Restores the more descriptive, specific name for use within this method.
	$post = $item;

	$att_title = _draft_or_post_title();
	$actions   = $this->_get_row_actions( $post, $att_title );

	return $this->row_actions( $actions );
}