Ticket #44821: 44821.4.diff
| File 44821.4.diff, 1.9 KB (added by , 8 years ago) |
|---|
-
src/wp-admin/includes/class-wp-terms-list-table.php
77 77 /** 78 78 */ 79 79 public function prepare_items() { 80 $tags_per_page = $this->get_items_per_page( 'edit_' . $this->screen->taxonomy . '_per_page' ); 80 $taxonomy = $this->screen->taxonomy; 81 $tags_per_page = $this->get_items_per_page( "edit_{$taxonomy}_per_page" ); 81 82 82 if ( 'post_tag' === $this->screen->taxonomy ) { 83 /** 84 * Filters the number of terms displayed per page for a specific taxonomy. 85 * 86 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy. 87 * 88 * Some examples of filter hooks generated here include: 'edit_post_tag_per_page', 89 * 'edit_category_per_page', 'edit_link_category_per_page', etc. 90 * 91 * @since 4.9.9 92 * 93 * @param int $tags_per_page Number of terms to be displayed. Default 20. 94 */ 95 $tags_per_page = apply_filters( "edit_{$taxonomy}_per_page", $tags_per_page ); 96 97 if ( 'post_tag' === $taxonomy ) { 83 98 /** 84 99 * Filters the number of terms displayed per page for the Tags list table. 85 100 * … … 98 113 * @param int $tags_per_page Number of tags to be displayed. Default 20. 99 114 */ 100 115 $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); 101 } elseif ( 'category' === $t his->screen->taxonomy ) {116 } elseif ( 'category' === $taxonomy ) { 102 117 /** 103 118 * Filters the number of terms displayed per page for the Categories list table. 104 119 * … … 129 144 130 145 $this->set_pagination_args( 131 146 array( 132 'total_items' => wp_count_terms( $t his->screen->taxonomy, compact( 'search' ) ),147 'total_items' => wp_count_terms( $taxonomy, compact( 'search' ) ), 133 148 'per_page' => $tags_per_page, 134 149 ) 135 150 );