这是一个code linked 通过@先天性地对自己的问题进行评论(解决方案),我只做了一点修改,并在WP 3.3.2(功能wpse39084)中进行了测试。它将在Post Edit和Quick Edit中显示订阅者。
还添加了两个操作(函数wpse50827),将Author元框移动到Publish actions元框中,以便于管理。
所有内容都与帖子相关,没有页面或CPT。。。
foreach( array( \'edit.php\', \'post.php\' ) as $hook )
add_action( "load-$hook", \'wpse39084_replace_post_meta_author\' );
/* Show Subscribers in post author dropdowns - edit and quickEdit */
function wpse39084_replace_post_meta_author()
{
global $typenow;
if( \'post\' != $typenow )
return;
add_action( \'admin_menu\', \'wpse50827_author_metabox_remove\' );
add_action( \'post_submitbox_misc_actions\', \'wpse50827_author_metabox_move\' );
add_filter( \'wp_dropdown_users\', \'wpse39084_showme_dropdown_users\' );
}
/* Modify authors dropdown */
function wpse39084_showme_dropdown_users( $args = \'\' )
{
$post = get_post();
$selected = $post->post_author;
$siteusers = get_users( \'orderby=nicename&order=ASC\' ); // you can pass filters and option
$re = \'\';
if( count( $siteusers ) > 0 )
{
$re = \'<select name="post_author_override" id="post_author_override">\';
foreach( $siteusers as $user )
{
$re .= \'<option value="\' . $user->ID . \'">\' . $user->user_nicename . \'</option>\';
}
$re .= \'</select>\';
$re = str_replace( \'value="\' . $selected . \'"\', \'value="\' . $selected . \'" selected="selected"\', $re );
}
echo $re;
}
/* Remove Author meta box from post editing */
function wpse50827_author_metabox_remove()
{
remove_meta_box( \'authordiv\', \'post\', \'normal\' );
}
/* Move Author meta box inside Publish Actions meta box */
function wpse50827_author_metabox_move()
{
global $post;
echo \'<div id="author" class="misc-pub-section" style="border-top-style:solid; border-top-width:1px; border-top-color:#EEEEEE; border-bottom-width:0px;">Author: \';
post_author_meta_box( $post );
echo \'</div>\';
}