ACF_Form_Gutenberg::modify_user_option_meta_box_orderpublicACF 5.8.2

modify_user_option_meta_box_order

Filters the meta-box-order_{$post_type} value by prepending "acf_after_title" data to "normal". Fixes a bug where metaboxes with position "acf_after_title" do not appear in the block editor.

Method of the class: ACF_Form_Gutenberg{}

No Hooks.

Returns

Array. Modified array with meta boxes moved around.

Usage

$ACF_Form_Gutenberg = new ACF_Form_Gutenberg();
$ACF_Form_Gutenberg->modify_user_option_meta_box_order( $locations );
$locations(required)
.

Changelog

Since 5.8.2 Introduced.

ACF_Form_Gutenberg::modify_user_option_meta_box_order() code ACF 6.0.4

function modify_user_option_meta_box_order( $locations ) {
	if ( ! empty( $locations['acf_after_title'] ) ) {
		if ( ! empty( $locations['normal'] ) ) {
			$locations['normal'] = $locations['acf_after_title'] . ',' . $locations['normal'];
		} else {
			$locations['normal'] = $locations['acf_after_title'];
		}
		unset( $locations['acf_after_title'] );
	}
	return $locations;
}