ACF_Form_Post::initialize │ public │ ACF 5.7.6

initialize

Sets up Form functionality.

Method of the class: ACF_Form_Post{}

No Hooks.

Returns

void. Nothing (null).

Usage

$ACF_Form_Post = new ACF_Form_Post();
$ACF_Form_Post->initialize();

Changelog

Since 5.7.6 Introduced.

ACF_Form_Post::initialize() code ACF 6.8.8

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