Uses
Uses | Description |
---|---|
wp-includes/l10n.php: __() | Retrieve the translation of $text. |
wp-includes/option.php: get_user_setting() | Retrieves user interface setting value based on setting name. |
Generates the required HTML for a list of row action links.
(string[]) (Required) An array of action links.
(bool) (Optional) Whether the actions should be always visible.
Default value: false
(string) The HTML for the row actions.
File: wp-admin/includes/class-wp-list-table.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; } $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">'; $i = 0; foreach ( $actions as $action => $link ) { ++$i; $sep = ( $i < $action_count ) ? ' | ' : ''; $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; }
Version | Description |
---|---|
3.1.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_list_table/row_actions