WP_List_Table::row_actions( array $actions, bool $always_visible = false )

Generate row actions div


Parameters

$actions

(Required) The list of actions

$always_visible

(Optional) Whether the actions should be always visible

Default value: false


Return

(string)


Source

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

	protected function row_actions( $actions, $always_visible = false ) {
		$action_count = count( $actions );
		$i = 0;

		if ( !$action_count )
			return '';

		$out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
		foreach ( $actions as $action => $link ) {
			++$i;
			( $i == $action_count ) ? $sep = '' : $sep = ' | ';
			$out .= "<span class='$action'>$link$sep</span>";
		}
		$out .= '</div>';

		$out .= '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>';

		return $out;
	}


Changelog

Changelog
Version Description
WP-3.1.0 Introduced.