Created
November 10, 2022 10:11
-
-
Save AndreFCAmorim/3101227181ee14537b0317052985599c to your computer and use it in GitHub Desktop.
Remove the default wp posts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Remove posts from dashboard menu | |
add_action( 'admin_menu', 'remove_default_post_type' ); | |
function remove_default_post_type() { | |
remove_menu_page( 'edit.php' ); | |
} | |
// Remove +New post in top Admin Menu Bar | |
add_action( 'admin_bar_menu', 'remove_default_post_type_menu_bar', 999 ); | |
function remove_default_post_type_menu_bar( $wp_admin_bar ) { | |
$wp_admin_bar->remove_node( 'new-post' ); | |
} | |
// Remove Quick Draft Dashboard Widget | |
add_action( 'wp_dashboard_setup', 'remove_draft_widget', 999 ); | |
function remove_draft_widget() { | |
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment