post_author_meta_box

函数
post_author_meta_box ( $post )
参数
  • (WP_Post) $post Current post object.
    Required:
定义位置
相关方法
post_custom_meta_boxpost_categories_meta_boxpost_submit_meta_boxpost_format_meta_boxpost_slug_meta_box
引入
2.6.0
弃用
-

post_author_meta_box: 该函数用于在文章编辑界面显示作者元框,显示文章作者的姓名和联系信息。

显示带有作者列表的表格字段。

function post_author_meta_box( $post ) {
	global $user_ID;

	$post_type_object = get_post_type_object( $post->post_type );
	?>
<label class="screen-reader-text" for="post_author_override"><?php _e( 'Author' ); ?></label>
	<?php
	wp_dropdown_users(
		array(
			'capability'       => array( $post_type_object->cap->edit_posts ),
			'name'             => 'post_author_override',
			'selected'         => empty( $post->ID ) ? $user_ID : $post->post_author,
			'include_selected' => true,
			'show'             => 'display_name_with_login',
		)
	);
}

常见问题

FAQs
查看更多 >
闪电伯伯

(工作日 10:00 - 18:30 为您服务)

2025-11-14 01:25:28

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: