对于多作者用户,在发布文章时提供作者选项非常实用。在主题目录的 function.php
中添加以下代码即可。
#代码来源:http://www.ludou.org/move-author-metabox-publish-metabox-wordpress.html
add_action( 'admin_menu', 'remove_author_metabox' );
add_action( 'post_submitbox_misc_actions', 'move_author_to_publish_metabox' );
function remove_author_metabox() {
remove_meta_box( 'authordiv', 'post', 'normal' );
}
function move_author_to_publish_metabox() {
global $post_ID;
$post = get_post( $post_ID );
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;">作者: ';
post_author_meta_box( $post );
echo '</div>';
}