I’m trying to remove the meta box that the Download Manager plugin creates, as it uses a hardcoded http iframe, caused a mixed content error in ssl.
Here is the code that generates the meta box:
wp_add_dashboard_widget('wpdm_dashboard_widget', 'WordPress Download Manager', 'wpdm_dashboard_widget_function');
and here is the code I’m using in my theme’s functions.php file:
function remove_dashboard_widgets(){
remove_meta_box('wpdm_dashboard_widget', 'dashboard', 'normal');
}
add_action('wp_dashboard_setup', 'remove_dashboard_widgets');
I also tried ‘dashboard-network’ as the 2nd parameter, as I’m running a multisite setup.
Neither worked for me. Where am I going wrong?
I found that this works:
I guess ‘admin_init’ is the key, so that it runs before the dashboard is loaded.