mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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:
@@ -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 = '';
|
||||
|
||||
Reference in New Issue
Block a user