Hi Colin,
The ShiftNav assets are loaded with these two hooks:
add_action( 'wp_enqueue_scripts' , 'shiftnav_load_assets' , 101 );
add_action( 'wp_enqueue_scripts' , 'shiftnav_pro_load_assets' , 20 );
To remove that ShiftNav assets, I’d just unhook those actions.
Since you’re using the Pro version, in the future please Submit a Ticket to the pro support center so we can make sure to see your ticket as soon as possible. Thanks 🙂
Chris
Thread Starter
cgold
(@cgold)
Can you please tell me which file this code is locate in? I have used the following code to deregister shiftnav plugin however its not working.
I have no problem using the same code to deregister other plugins.
function my_deregister_javascript() {
wp_deregister_script( ‘shiftnav_load_assets’ );
wp_deregister_script( ‘shiftnav_pro_load_assets’ );
}
Hi Colin,
That code doesn’t make sense, because those are action functions, not asset handles.
As I said, you should unhook the actions, not dequeue the scripts.
The code would just be something like this
add_action( 'wp' , 'remove_shiftnav_assets' );
function remove_shiftnav_assets(){
remove_action( 'wp_enqueue_scripts' , 'shiftnav_load_assets' , 101 );
remove_action( 'wp_enqueue_scripts' , 'shiftnav_pro_load_assets' , 20 );
}
Again, if you have any further questions, please Submit a Ticket. Thanks.
Chris