Make WordPress Core

Ticket #42669: patch-to-add-filter-admin_term_links.v3.diff

File patch-to-add-filter-admin_term_links.v3.diff, 1.3 KB (added by DaveFX, 7 years ago)

New version of the patch.

  • wp-admin/includes/class-wp-posts-list-table.php

    diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php
    index 5988c3eaca..7072fe8b25 100644
    a b class WP_Posts_List_Table extends WP_List_Table { 
    11111111                                        $label = esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) );
    11121112                                        $out[] = $this->get_edit_link( $posts_in_term_qv, $label );
    11131113                                }
     1114                                /**
     1115                                 * Filters the html text including the list of terms for a taxonomy and post on the Posts list table.
     1116                                 *
     1117                                 * @since 4.9.1
     1118                                 *
     1119                                 * @param array  $out      An array of HTML formatted links to the terms corresponding to the taxonomy.
     1120                                 * @param int    $post_id  The current post ID.
     1121                                 * @param string $taxonomy The taxonomy.
     1122                                 */
     1123                                $term_list = apply_filters( "admin_term_links-{$taxonomy}", $out, $post->ID, $taxonomy );
     1124
    11141125                                /* translators: used between list items, there is a space after the comma */
    1115                                 echo join( __( ', ' ), $out );
     1126                                echo join( __( ', ' ), $term_list );
    11161127                        } else {
    11171128                                echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . $taxonomy_object->labels->no_terms . '</span>';
    11181129                        }