post_author_meta_box

The timeline below displays how wordpress function post_author_meta_box has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Displays form field with list of authors.
 *
 * @since 2.6.0
 *
 * @global int $user_ID
 *
 * @param WP_Post $post Current post object.
 */
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 
    /* translators: Hidden accessibility text. */
    _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'));
}

WordPress Version: 6.1

/**
 * Displays form field with list of authors.
 *
 * @since 2.6.0
 *
 * @global int $user_ID
 *
 * @param WP_Post $post Current post object.
 */
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'));
}

WordPress Version: 5.9

/**
 * Display form field with list of authors.
 *
 * @since 2.6.0
 *
 * @global int $user_ID
 *
 * @param WP_Post $post
 */
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'));
}

WordPress Version: 5.6

/**
 * Display form field with list of authors.
 *
 * @since 2.6.0
 *
 * @global int $user_ID
 *
 * @param WP_Post $post
 */
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'));
}

WordPress Version: 5.1

/**
 * Display form field with list of authors.
 *
 * @since 2.6.0
 *
 * @global int $user_ID
 *
 * @param object $post
 */
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'));
}

WordPress Version: 4.5

/**
 * Display form field with list of authors.
 *
 * @since 2.6.0
 *
 * @global int $user_ID
 *
 * @param object $post
 */
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'));
}

WordPress Version: 4.3

/**
 * Display form field with list of authors.
 *
 * @since 2.6.0
 *
 * @global int $user_ID
 *
 * @param object $post
 */
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));
}

WordPress Version: 3.7

/**
 * Display form field with list of authors.
 *
 * @since 2.6.0
 *
 * @param object $post
 */
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));
}