Make WordPress Core


Ignore:
Timestamp:
01/28/2008 05:21:14 PM (17 years ago)
Author:
ryan
Message:

Tag searching from jhodgdon. see #5684

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r6660 r6670  
    262262// assuming M tags displayed at a time on the page
    263263// Returns the number of tags displayed
    264 function tag_rows( $page = 0, $pagesize = 20 ) {
     264function tag_rows( $page = 0, $pagesize = 20, $searchterms = '' ) {
    265265   
    266266    // Get a page worth of tags
    267267    $start = $page * $pagesize;
    268     $tags = get_terms( 'post_tag', "offset=$start&number=$pagesize&hide_empty=0"  );
     268
     269    $args = array('offset' => $start, 'number' => $pagesize, 'hide_empty' => 0);
     270 
     271    if ( !empty( $searchterms ) )
     272        $args['name__like'] = $searchterms;
     273
     274    $tags = get_terms( 'post_tag', $args );
    269275   
    270276    // convert it to table rows
Note: See TracChangeset for help on using the changeset viewer.