Have you tried the custom_menu_order and menu_order filters? I’m not entirely sure if they work with AME installed (AME settings will probably override the sort order), but it might be worth a shot.
Alternatively, you could use the AME-specific custom_admin_menu and custom_admin_submenu filters to change the position property of menu items. Here’s an (untested) example:
function test_change_position($item) {
if ($item['file'] == 'options-general.php') {
$item['position'] = 123;
}
return $item;
}
add_filter('custom_admin_submenu', 'test_change_position');
Thanks for the quick reply. Still no luck though…
This…
function test_change_position($item) {
if ($item['menu_title'] == 'Cases') {
$item['position'] = 4;
}
return $item;
}
add_filter('custom_admin_menu', 'test_change_position');
Moved it into the right place if I ran another filter and print_r all the $items, but the actual menu didn’t change.
Kinda the same thing with custom_menu_order / menu_order…
function my_menu_order( $menu_order ) {
pre($menu_order,0);
return $menu_order;
}
add_filter( 'custom_menu_order', '__return_true');
add_filter( 'menu_order', 'my_menu_order' );
…actually showed the post_types where desired but the displays differently.
Maybe this is happening before AME? I tried 1/9999999 priorities. Perhaps there is a caching mechanism that I need to flush somehow?
Thanks again for your help,
Philip
Sorry, I really should have tested that suggestion. I double-checked the relevant code and “position” is one of a handful of fields that can’t be changed in custom_admin_menu. That is, you can set it to a new value, but the current version of the plugin will completely ignore the change.
That’s been fixed in the development version. Now the test_change_position snippet should actually work:
https://downloads.wp.xz.cn/plugin/admin-menu-editor.zip
Update: Contact me via email for a patch for the Pro version.
Thanks Janis. I’ve sent an email a few days ago for when you get a chance.
π
I received your email, but when I tried to reply I got back a response saying “wrong email address” (just that, nothing more) from some other person @ your domain name. Could you please double-check the email address and try again?
Hm, weird, must have put it in wrong or something. Just resent with two addresses in it.
Thanks again!
I’ve sent the patch; hopefully it’ll reach you this time.