Make WordPress Core

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

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

Patch that adds the new filter

  • 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..f17df6cc21 100644
    a b  
    1 <?php
     1 <?php
    22/**
    33 * List Table API: WP_Posts_List_Table class
    44 *
    class WP_Posts_List_Table extends WP_List_Table { 
    11121112                                        $out[] = $this->get_edit_link( $posts_in_term_qv, $label );
    11131113                                }
    11141114                                /* translators: used between list items, there is a space after the comma */
    1115                                 echo join( __( ', ' ), $out );
     1115                                $term_list_html = join( __( ', ' ), $out );
     1116
     1117                                /**
     1118                                 * Filters the html text including the list of terms for a taxonomy and post on the Posts list table.
     1119                                 *
     1120                                 * @since 4.9.1
     1121                                 *
     1122                                 * @param string $term_list_html The HTML for the term list corresponding to the taxonomy to display.
     1123                                 * @param int    $post_id        The current post ID.
     1124                                 * @param string $taxonomy       The taxonomy.
     1125                                 */
     1126                                echo apply_filters( "admin_term_links-{$taxonomy}", $term_list_html, $post->ID, $taxonomy );
    11161127                        } else {
    11171128                                echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . $taxonomy_object->labels->no_terms . '</span>';
    11181129                        }