ACF_Form_Post::initialize
initialize
Sets up Form functionality.
Метод класса: ACF_Form_Post{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ACF_Form_Post = new ACF_Form_Post(); $ACF_Form_Post->initialize();
Список изменений
| С версии 5.7.6 | Введена. |
Код ACF_Form_Post::initialize() ACF Form Post::initialize ACF 6.4.2
function initialize() {
// globals
global $typenow;
$acf_post_types = acf_get_internal_post_types();
foreach ( $acf_post_types as $post_type ) {
remove_meta_box( 'submitdiv', $post_type, 'side' );
}
// restrict specific post types
$restricted = array_merge( $acf_post_types, array( 'acf-taxonomy', 'attachment' ) );
if ( in_array( $typenow, $restricted ) ) {
return;
}
// enqueue scripts
acf_enqueue_scripts(
array(
'uploader' => true,
)
);
// actions
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 10, 2 );
}