Skip to content

Instantly share code, notes, and snippets.

@tomjn
Last active December 9, 2015 22:18
Show Gist options
  • Save tomjn/4336029 to your computer and use it in GitHub Desktop.
Save tomjn/4336029 to your computer and use it in GitHub Desktop.
Disables Jetpacks menu reordering code
<?php
/*
Plugin Name: Jetpack Menu Weight
Plugin URI: http://tomjn.com
Description: Fixes the broken Jetpack menu reordering by removing it
Author: Tom J Nowell
Contributors: TJNowell
Version: 1.0
Author URI: http://tomjn.com
*/
if(class_exists('Jetpack')){
function jetpack_remove_menu_filters(){
$jetpack = Jetpack::init();
$removed = remove_filter('custom_menu_order',array($jetpack,'admin_menu_order'));
remove_filter('menu_order',array($jetpack,'jetpack_menu_order'));
}
add_action('jetpack_admin_menu','jetpack_remove_menu_filters');
}
@tomjn
Copy link
Author

tomjn commented Dec 19, 2012

revision 3 fixes things, seems I was barking up the wrong tree, need to add it to the action thats ran immediately after the filters are added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment