Mustafa Uysal

I'm traveling light, it's au revoir…

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:

[code] add_filter(‘post_meta_box_order_force_override’,’__return_true’);[/code]

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

Example:

[code]
add_filter(‘post_meta_box_order_hash’, ‘my_meta_box_order_hash’ );

function my_meta_box_order_hash( $default_hash ){
return ‘10072016foobarbaz’;
}
[/code]

post_meta_box_order_left_column: order items of left column

Example:

[code]
add_filter( ‘post_meta_box_order_left_column’, ‘order_left_cols’ );

function order_left_cols( $cols ) {
array_unshift( $cols, ‘slugdiv’ );

return $cols;
}
[/code]

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

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.