W3cubDocs

/WordPress

WP_Links_List_Table::handle_row_actions( object $link, string $column_name, string $primary )

Generates and displays row action links.

Description

Parameters

$link

(object) (Required) Link being acted upon.

$column_name

(string) (Required) Current column name.

$primary

(string) (Required) Primary column name.

Return

(string) Row action output for links.

Source

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

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

		$edit_link = get_edit_bookmark_link( $link );

		$actions           = array();
		$actions['edit']   = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
		$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( "You are about to delete this link '%s'\n  'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ) . "' ) ) { return true;}return false;\">" . __( 'Delete' ) . '</a>';
		return $this->row_actions( $actions );
	}

Changelog

Version Description
4.3.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_links_list_table/handle_row_actions