Post Meta Box Order V2

Post Meta Box Order version 2 comes with breaking changes.

Filters

Editing plugin source (before) unacceptably stupid approach and version 2 fixes this problem.

post_meta_box_order_force_override: If you want to force users? set it true

Example:

 add_filter('post_meta_box_order_force_override','__return_true');

post_meta_box_order_hash: to change hash obviously.
Don’t forget, when hash changes, it will overwrite order that users have.

Example:

 add_filter('post_meta_box_order_hash', 'my_meta_box_order_hash' );

 function my_meta_box_order_hash( $default_hash ){
 	return '10072016foobarbaz';
 }

post_meta_box_order_left_column: order items of left column

Example:

add_filter( 'post_meta_box_order_left_column', 'order_left_cols' );

function order_left_cols( $cols ) {
	array_unshift( $cols, 'slugdiv' );

	return $cols;
}

post_meta_box_order_right_column: order items of right column.

Sorry for breaking changes, I hate them but sometimes we need to break things to fix this kind of stupidness.

Cheers,

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s