Tag searching from jhodgdon. see #5684

git-svn-id: https://develop.svn.wordpress.org/trunk@6670 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-01-28 17:21:14 +00:00
parent a8eb580138
commit 6bfc62a22b
2 changed files with 19 additions and 3 deletions
+8 -2
View File
@@ -261,11 +261,17 @@ function _tag_row( $tag, $class = '' ) {
// Outputs appropriate rows for the Nth page of the Tag Management screen,
// assuming M tags displayed at a time on the page
// Returns the number of tags displayed
function tag_rows( $page = 0, $pagesize = 20 ) {
function tag_rows( $page = 0, $pagesize = 20, $searchterms = '' ) {
// Get a page worth of tags
$start = $page * $pagesize;
$tags = get_terms( 'post_tag', "offset=$start&number=$pagesize&hide_empty=0" );
$args = array('offset' => $start, 'number' => $pagesize, 'hide_empty' => 0);
if ( !empty( $searchterms ) )
$args['name__like'] = $searchterms;
$tags = get_terms( 'post_tag', $args );
// convert it to table rows
$out = '';