Uses
| Uses | Description |
|---|---|
| wp-includes/l10n.php: _e() | Display translated text. |
| wp-includes/user.php: wp_dropdown_users() | Create dropdown HTML content of users. |
Display form field with list of authors.
(object) (Required)
File: wp-admin/includes/meta-boxes.php
function post_author_meta_box( $post ) {
global $user_ID;
?>
<label class="screen-reader-text" for="post_author_override"><?php _e( 'Author' ); ?></label>
<?php
wp_dropdown_users(
array(
'who' => 'authors',
'name' => 'post_author_override',
'selected' => empty( $post->ID ) ? $user_ID : $post->post_author,
'include_selected' => true,
'show' => 'display_name_with_login',
)
);
} | Version | Description |
|---|---|
| 2.6.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/post_author_meta_box