Removing meta box from dashboard
The plugin adds the “WP Armour Anti Spam Statistics” meta box to the main admin dashboard. I generally like to keep the dashboard clean of anything my clients are not using, but my usual way of removing the standard meta boxes doesn’t seem to work with the plugin. I am specifically looking for a way to remove the entire meta box through code, so that each user doesn’t have to manually tick the checkboxes to manage their view.
In the plugin files, I found the following:
add_meta_box( 'wpa_dashboard_widget', 'WP Armour Anti Spam Statistics', 'wpa_dashboard_widget_function', 'dashboard', 'side', 'high');
Below is one remove_meta_box for a normal dashboard item (working), and the one I tried for the plugin based on the code above (not working).
function remove_dashboard_meta() {
remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');
remove_meta_box( 'wpa_dashboard_widget', 'dashboard', 'side');
}
add_action( 'admin_init', 'remove_dashboard_meta' );
Help would be much appreciated, thanks.
مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد
منبع: انجمن وردپرس