wordpress后台文章通过作者进行筛选设置方式,这段代码就可以!
将这段代码放到主题的functions.php中即可:
/*根据作者筛选文章*/
function dahuzi_filter_by_the_author() {
$params = array(
'name' => 'author',
'show_option_all' => '全部作者'
);
if ( isset($_GET['user']) )
$params['selected'] = $_GET['user'];
wp_dropdown_users( $params );
}
add_action('restrict_manage_posts', 'dahuzi_filter_by_the_author');
/*根据作者筛选文章*/
0