-
Home
-
Autopost for X (formerly Autoshare for Twitter)
- Tips
How to Hide the "Autopost for X/Twitter" Admin Menu
function plt_hide_autoshare_for_twitter_menus() {
//Hide the "Settings → Autopost for X/Twitter" menu.
remove_submenu_page('options-general.php', 'autoshare-for-twitter');
}
add_action('admin_menu', 'plt_hide_autoshare_for_twitter_menus', 11);
Where do I put this code?
How to Hide the "Autopost for X/Twitter" Meta Box
function plt_hide_autoshare_for_twitter_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Autopost for X/Twitter" meta box.
remove_meta_box('autoshare_for_twitter_metabox', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_autoshare_for_twitter_metaboxes', 20);
How to Hide the "Autopost for X — Rate Monitor" Dashboard Widget
function plt_hide_autoshare_for_twitter_dashboard_widgets() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Remove the "Autopost for X — Rate Monitor" widget.
remove_meta_box('autopost_for_x_rate_monitor_dashboard_widget', 'dashboard', 'normal');
}
add_action('wp_dashboard_setup', 'plt_hide_autoshare_for_twitter_dashboard_widgets', 20);