ACF_Admin_Post_type::admin_head
Sets up all functionality for the post type edit page to work.
Метод класса: ACF_Admin_Post_type{}
Хуки из метода
Возвращает
null. Ничего (null).
Использование
$ACF_Admin_Post_type = new ACF_Admin_Post_type(); $ACF_Admin_Post_type->admin_head();
Список изменений
| С версии 3.1.8 | Введена. |
Код ACF_Admin_Post_type::admin_head() ACF Admin Post type::admin head ACF 6.4.2
public function admin_head() {
// global.
global $post, $acf_post_type;
// set global var.
$acf_post_type = acf_get_internal_post_type( $post->ID, $this->post_type );
if ( ! empty( $acf_post_type['not_registered'] ) ) {
acf_add_admin_notice(
__( 'This post type could not be registered because its key is in use by another post type registered by another plugin or theme.', 'acf' ),
'error'
);
}
// metaboxes.
add_meta_box( 'acf-basic-settings', __( 'Basic Settings', 'acf' ), array( $this, 'mb_basic_settings' ), 'acf-post-type', 'normal', 'high' );
add_meta_box( 'acf-advanced-settings', __( 'Advanced Settings', 'acf' ), array( $this, 'mb_advanced_settings' ), 'acf-post-type', 'normal', 'high' );
// actions.
add_action( 'post_submitbox_misc_actions', array( $this, 'post_submitbox_misc_actions' ), 10, 0 );
add_action( 'edit_form_after_title', array( $this, 'edit_form_after_title' ), 10, 0 );
// filters.
add_filter( 'screen_settings', array( $this, 'screen_settings' ), 10, 1 );
add_filter( 'get_user_option_screen_layout_acf-post-type', array( $this, 'screen_layout' ), 10, 1 );
add_filter( 'get_user_option_metaboxhidden_acf-post-type', array( $this, 'force_basic_settings' ), 10, 1 );
add_filter( 'get_user_option_closedpostboxes_acf-post-type', array( $this, 'force_basic_settings' ), 10, 1 );
add_filter( 'get_user_option_closedpostboxes_acf-post-type', array( $this, 'force_advanced_settings' ), 10, 1 );
// 3rd party hook.
do_action( 'acf/post_type/admin_head' );
}