Making product image meta box more prominent as a default (#33707)
This commit is contained in:
parent
4707dcbec0
commit
6c13fdf0ce
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: update
|
||||
|
||||
Making default state of product image meta boxes more prominent.
|
|
@ -43,6 +43,7 @@ class WC_Admin_Meta_Boxes {
|
|||
add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 10 );
|
||||
add_action( 'add_meta_boxes', array( $this, 'rename_meta_boxes' ), 20 );
|
||||
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 30 );
|
||||
add_action( 'add_meta_boxes', array( $this, 'add_product_boxes_sort_order' ), 40 );
|
||||
add_action( 'save_post', array( $this, 'save_meta_boxes' ), 1, 2 );
|
||||
|
||||
/**
|
||||
|
@ -166,6 +167,28 @@ class WC_Admin_Meta_Boxes {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add default sort order for meta boxes on product page.
|
||||
*/
|
||||
public function add_product_boxes_sort_order() {
|
||||
$current_value = get_user_meta( get_current_user_id(), 'meta-box-order_product', true );
|
||||
|
||||
if ( $current_value ) {
|
||||
return;
|
||||
}
|
||||
|
||||
update_user_meta(
|
||||
get_current_user_id(),
|
||||
'meta-box-order_product',
|
||||
array(
|
||||
'side' => 'submitdiv,postimagediv,woocommerce-product-images,product_catdiv,tagsdiv-product_tag',
|
||||
'normal' => 'woocommerce-product-data,postcustom,slugdiv,postexcerpt',
|
||||
'advanced' => '',
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove bloat.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue