post_author_meta_box()
Displays form field with list of authors.
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
post_author_meta_box( $post );
- $post(WP_Post) (обязательный)
- Current post object.
Заметки
- Global. int. $user_ID
Список изменений
С версии 2.6.0 | Введена. |
Код post_author_meta_box() post author meta box WP 6.5.2
<?php 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', ) ); }