wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



post_author_meta_box › WordPress Function

Da2.6.0
Deprecaton/a
post_author_meta_box ( $post )
Parametri:
  • (WP_Post) $post Current post object.
    Richiesto:
Definito a:
Codex:

Displays form field with list of authors.



Sorgenti

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',
		)
	);
}