Title: WP_Links_List_Table::handle_row_actions
Published: August 18, 2015
Last modified: May 20, 2026

---

# WP_Links_List_Table::handle_row_actions( object $item, string $column_name, string $primary ): string

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_links_list_table/handle_row_actions/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_links_list_table/handle_row_actions/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_links_list_table/handle_row_actions/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_links_list_table/handle_row_actions/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_links_list_table/handle_row_actions/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_links_list_table/handle_row_actions/?output_format=md#wp--skip-link--target)

Generates and displays row action links.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_links_list_table/handle_row_actions/?output_format=md#parameters)󠁿

 `$item`objectrequired

Link being acted upon.

`$column_name`stringrequired

Current column name.

`$primary`stringrequired

Primary column name.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_links_list_table/handle_row_actions/?output_format=md#return)󠁿

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

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_links_list_table/handle_row_actions/?output_format=md#source)󠁿

    ```php
    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.
    	$link = $item;

    	$edit_link = get_edit_bookmark_link( $link );

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

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

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-links-list-table.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/class-wp-links-list-table.php#L345)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/class-wp-links-list-table.php#L345-L366)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_links_list_table/handle_row_actions/?output_format=md#related)󠁿

| Uses | Description | 
| [esc_js()](https://developer.wordpress.org/reference/functions/esc_js/)`wp-includes/formatting.php` |

Escapes single quotes, `"`, , `&amp;`, and fixes line endings.

  | 
| [get_edit_bookmark_link()](https://developer.wordpress.org/reference/functions/get_edit_bookmark_link/)`wp-includes/link-template.php` |

Displays the edit bookmark link.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [wp_nonce_url()](https://developer.wordpress.org/reference/functions/wp_nonce_url/)`wp-includes/functions.php` |

Retrieves URL with nonce added to URL query.

  |

[Show 2 more](https://developer.wordpress.org/reference/classes/wp_links_list_table/handle_row_actions/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_links_list_table/handle_row_actions/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_links_list_table/handle_row_actions/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Renamed `$link` to `$item` to match parent class for PHP 8 named parameter support. | 
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_links_list_table%2Fhandle_row_actions%2F)
before being able to contribute a note or feedback.