Support

Account

Home Forums Backend Issues (wp-admin) Move ACF fields below WooCommerce custom fields

Solved

Move ACF fields below WooCommerce custom fields

  • On the WooCommerce product edit screen, ACF fields groups are displayed above WooCommerce’s own custom fields/metaboxes. Does anyone know how to move ACF fields to the bottom of the screen?

  • Solved, dunno if there’s an easier way?

    function move_acf_meta_box() {
        global $wp_meta_boxes;
    
        $post_type = 'product';
        
        // Get ACF meta box.
        $acf_meta_box = $wp_meta_boxes[$post_type]['normal']['high']['acf-group_69266351484e9'];
        unset( $wp_meta_boxes[$post_type]['normal']['high']['acf-group_69266351484e9'] );
        
        // Move it to 'normal' location with 'low' priority.
        if ( empty( $wp_meta_boxes[$post_type]['normal']['low'] ) ) {
            $wp_meta_boxes[$post_type]['normal']['low'] = [];
        }
        $wp_meta_boxes[$post_type]['normal']['low']['acf-group_69266351484e9'] = $acf_meta_box;
        
    }
    add_action( 'add_meta_boxes', 'move_acf_meta_box', 99 );
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.