Ticket #5684: tagsearch.diff
File tagsearch.diff, 2.1 KB (added by , 17 years ago) |
---|
-
E:/EclipseWorkWeb/WordPressDev/wp-admin/includes/template.php
261 261 // Outputs appropriate rows for the Nth page of the Tag Management screen, 262 262 // assuming M tags displayed at a time on the page 263 263 // Returns the number of tags displayed 264 function tag_rows( $page = 0, $pagesize = 20 ) {264 function tag_rows( $page = 0, $pagesize = 20, $searchterms = '' ) { 265 265 266 266 // Get a page worth of tags 267 267 $start = $page * $pagesize; 268 $tags = get_terms( 'post_tag', "offset=$start&number=$pagesize&hide_empty=0" );269 268 269 $search = ''; 270 if( strlen( $searchterms )) { 271 $searchterms = attribute_escape( $searchterms ); 272 $search = "&name__like=%$searchterms"; 273 } 274 275 $tags = get_terms( 'post_tag', "offset=$start&number=$pagesize&hide_empty=0$search" ); 276 270 277 // convert it to table rows 271 278 $out = ''; 272 279 $class = ''; -
E:/EclipseWorkWeb/WordPressDev/wp-admin/edit-tags.php
86 86 <?php else : ?> 87 87 <h2><?php _e('Tags') ?> </h2> 88 88 <?php endif; ?> 89 90 <form name="searchform" id="searchform" action="" method="get"> 91 <fieldset><legend><?php _e('Tag contains…'); ?></legend> 92 <input type="text" name="s" id="s" value="<?php echo stripslashes( $_GET[ 's' ]); ?>" size="17" /> 93 </fieldset> 94 95 <input type="submit" id="post-query-submit" value="<?php _e('Filter »'); ?>" class="button" /> 96 </form> 97 <br style="clear:both;" /> 98 99 89 100 <table class="widefat"> 90 101 <thead> 91 102 <tr> … … 101 112 if( !$tagsperpage || $tagsperpage < 0 ) { 102 113 $tagsperpage = 20; 103 114 } 104 $count = tag_rows( $pagenum, $tagsperpage ); 115 $searchterms = trim( $_GET['s'] ); 116 117 $count = tag_rows( $pagenum, $tagsperpage, $searchterms ); 105 118 ?> 106 119 </tbody> 107 120 </table>