WP_Links_List_Table::handle_row_actions()
Generates and displays row action links.
Метод класса: WP_Links_List_Table{}
Хуков нет.
Возвращает
Строку
. Row actions output for links, or an empty string if the current column is not the primary column.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->handle_row_actions( $item, $column_name, $primary );
- $item(объект) (обязательный)
- Link being acted upon.
- $column_name(строка) (обязательный)
- Current column name.
- $primary(строка) (обязательный)
- Primary column name.
Список изменений
С версии 4.3.0 | Введена. |
С версии 5.9.0 | Renamed $link to $item to match parent class for PHP 8 named parameter support. |
Код WP_Links_List_Table::handle_row_actions() WP Links List Table::handle row actions WP 6.7.2
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&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 ); }