post_author_meta_box
Display form field with list of authors.
Description
post_author_meta_box( (object) $post );
Parameters (1)
- 0. $post (object)
- The post.
Usage
if ( !function_exists( 'post_author_meta_box' ) ) { require_once ABSPATH . '/wp-admin/includes/meta-boxes.php'; } // The post. $post = null; // NOTICE! Understand what this does before running. $result = post_author_meta_box($post);
Defined (1)
The function is defined in the following location(s).
- /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',
- ) );
- }