+ /**
+ * Generates and displays row action links.
+ *
+ * @since 4.3.0
+ * @access protected
+ *
+ * @param object $tag Tag being acted upon.
+ * @param string $column_name Current column name.
+ * @param string $primary Primary column name.
+ * @return string Row actions output for terms.
+ */
+ protected function handle_row_actions( $tag, $column_name, $primary ) {
+ if ( $primary !== $column_name ) {
+ return '';
+ }
+
+ $taxonomy = $this->screen->taxonomy;
+ $tax = get_taxonomy( $taxonomy );
+ $default_term = get_option( 'default_' . $taxonomy );
+
+ $uri = ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ? wp_get_referer() : $_SERVER['REQUEST_URI'];
+
+ $edit_link = add_query_arg(
+ 'wp_http_referer',
+ urlencode( wp_unslash( $uri ) ),
+ get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type )
+ );
+
+ $actions = array();
+ if ( current_user_can( $tax->cap->edit_terms ) ) {
+ $actions['edit'] = sprintf(
+ '<a href="%s" aria-label="%s">%s</a>',
+ esc_url( $edit_link ),
+ /* translators: %s: taxonomy term name */
+ esc_attr( sprintf( __( 'Edit “%s”' ), $tag->name ) ),
+ __( 'Edit' )
+ );
+ $actions['inline hide-if-no-js'] = sprintf(
+ '<a href="#" class="editinline aria-button-if-js" aria-label="%s">%s</a>',
+ /* translators: %s: taxonomy term name */
+ esc_attr( sprintf( __( 'Quick edit “%s” inline' ), $tag->name ) ),
+ __( 'Quick Edit' )
+ );
+ }
+ if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term ) {
+ $actions['delete'] = sprintf(
+ '<a href="%s" class="delete-tag aria-button-if-js" aria-label="%s">%s</a>',
+ wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ),
+ /* translators: %s: taxonomy term name */
+ esc_attr( sprintf( __( 'Delete “%s”' ), $tag->name ) ),
+ __( 'Delete' )
+ );
+ }
+ if ( $tax->public ) {
+ $actions['view'] = sprintf(
+ '<a href="%s" aria-label="%s">%s</a>',
+ get_term_link( $tag ),
+ /* translators: %s: taxonomy term name */
+ esc_attr( sprintf( __( 'View “%s” archive' ), $tag->name ) ),
+ __( 'View' )
+ );
+ }
+
+ /**
+ * Filters the action links displayed for each term in the Tags list table.
+ *
+ * @since 2.8.0
+ * @deprecated 3.0.0 Use {$taxonomy}_row_actions instead.
+ *
+ * @param array $actions An array of action links to be displayed. Default
+ * 'Edit', 'Quick Edit', 'Delete', and 'View'.
+ * @param object $tag Term object.
+ */
+ $actions = apply_filters( 'tag_row_actions', $actions, $tag );
+
+ /**
+ * Filters the action links displayed for each term in the terms list table.
+ *
+ * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
+ *
+ * @since 3.0.0
+ *
+ * @param array $actions An array of action links to be displayed. Default
+ * 'Edit', 'Quick Edit', 'Delete', and 'View'.
+ * @param object $tag Term object.
+ */
+ $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );
+
+ return $this->row_actions( $actions );