Title: WP_List_Table::row_actions
Published: April 25, 2014
Last modified: April 28, 2025

---

# WP_List_Table::row_actions( string[] $actions, bool $always_visible = false ): string

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_list_table/row_actions/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_list_table/row_actions/?output_format=md#return)
 * [More Information](https://developer.wordpress.org/reference/classes/wp_list_table/row_actions/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/classes/wp_list_table/row_actions/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_list_table/row_actions/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_list_table/row_actions/?output_format=md#changelog)

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

Generates the required HTML for a list of row action links.

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

 `$actions`string[]required

An array of action links.

`$always_visible`booloptional

Whether the actions should be always visible.

Default:`false`

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

 string The HTML for the row actions.

## 󠀁[More Information](https://developer.wordpress.org/reference/classes/wp_list_table/row_actions/?output_format=md#more-information)󠁿

Call this method (usually from one of your column methods) to insert a row actions
div. The $actions parameter should be an associative array, where the key is the
name of the action and the value is a link.

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

    ```php
    protected function row_actions( $actions, $always_visible = false ) {
    	$action_count = count( $actions );

    	if ( ! $action_count ) {
    		return '';
    	}

    	$mode = get_user_setting( 'posts_list_mode', 'list' );

    	if ( 'excerpt' === $mode ) {
    		$always_visible = true;
    	}

    	$output = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';

    	$i = 0;

    	foreach ( $actions as $action => $link ) {
    		++$i;

    		$separator = ( $i < $action_count ) ? ' | ' : '';

    		$output .= "<span class='$action'>{$link}{$separator}</span>";
    	}

    	$output .= '</div>';

    	$output .= '<button type="button" class="toggle-row"><span class="screen-reader-text">' .
    		/* translators: Hidden accessibility text. */
    		__( 'Show more details' ) .
    	'</span></button>';

    	return $output;
    }
    ```

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

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

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

Retrieves user interface setting value based on setting name.

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

Retrieves the translation of $text.

  |

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

| Version | Description | 
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |

## User Contributed Notes

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