mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-16 07:35:39 +01:00
Add per page screen option for tags
git-svn-id: http://svn.automattic.com/wordpress/trunk@10909 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1164645872
commit
f2208f3c91
@ -1041,6 +1041,7 @@ case 'set-screen-option':
|
|||||||
case 'edit_comments_per_page':
|
case 'edit_comments_per_page':
|
||||||
case 'upload_per_page':
|
case 'upload_per_page':
|
||||||
case 'categories_per_page':
|
case 'categories_per_page':
|
||||||
|
case 'edit_tags_per_page':
|
||||||
$value = (int) $value;
|
$value = (int) $value;
|
||||||
if ( $value < 1 || $value > 999 )
|
if ( $value < 1 || $value > 999 )
|
||||||
die(-1);
|
die(-1);
|
||||||
|
@ -177,14 +177,18 @@ $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
|
|||||||
if ( empty($pagenum) )
|
if ( empty($pagenum) )
|
||||||
$pagenum = 1;
|
$pagenum = 1;
|
||||||
|
|
||||||
$tagsperpage = apply_filters("tagsperpage",20);
|
$tags_per_page = get_user_option('edit_tags_per_page');
|
||||||
|
if ( empty($tags_per_page) )
|
||||||
|
$tags_per_page = 20;
|
||||||
|
$tags_per_page = apply_filters('edit_tags_per_page', $tags_per_page);
|
||||||
|
$tags_per_page = apply_filters('tagsperpage', $tags_per_page); // Old filter
|
||||||
|
|
||||||
$page_links = paginate_links( array(
|
$page_links = paginate_links( array(
|
||||||
'base' => add_query_arg( 'pagenum', '%#%' ),
|
'base' => add_query_arg( 'pagenum', '%#%' ),
|
||||||
'format' => '',
|
'format' => '',
|
||||||
'prev_text' => __('«'),
|
'prev_text' => __('«'),
|
||||||
'next_text' => __('»'),
|
'next_text' => __('»'),
|
||||||
'total' => ceil(wp_count_terms($taxonomy) / $tagsperpage),
|
'total' => ceil(wp_count_terms($taxonomy) / $tags_per_page),
|
||||||
'current' => $pagenum
|
'current' => $pagenum
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -224,7 +228,7 @@ if ( $page_links )
|
|||||||
|
|
||||||
$searchterms = isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '';
|
$searchterms = isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '';
|
||||||
|
|
||||||
$count = tag_rows( $pagenum, $tagsperpage, $searchterms, $taxonomy );
|
$count = tag_rows( $pagenum, $tags_per_page, $searchterms, $taxonomy );
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -3526,6 +3526,9 @@ function screen_options($screen) {
|
|||||||
case 'categories':
|
case 'categories':
|
||||||
$per_page_label = __('Categories per page:');
|
$per_page_label = __('Categories per page:');
|
||||||
break;
|
break;
|
||||||
|
case 'edit-tags':
|
||||||
|
$per_page_label = __('Tags per page:');
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user