Created
August 20, 2020 15:04
-
-
Save raulillana/e104ae9d03f5e127a03665fbf5adfc7f to your computer and use it in GitHub Desktop.
Remove WordPress default Blog Post Type (because sometimes, there's just no blog, LOL…)
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 default Posts type since NO BLOG LOL | |
* | |
* Remove side menu | |
*/ | |
function mercs_remove_default_post_type() { | |
remove_menu_page( 'edit.php' ); | |
} | |
add_action( 'admin_menu', 'mercs_remove_default_post_type' ); | |
/** | |
* Remove default Posts type since NO BLOG LOL | |
* | |
* Remove +New post in top Admin Menu Bar | |
*/ | |
function mercs_remove_default_post_type_menu_bar( $wp_admin_bar ) { | |
$wp_admin_bar->remove_node( 'new-post' ); | |
} | |
add_action( 'admin_bar_menu', 'mercs_remove_default_post_type_menu_bar', 999 ); | |
/** | |
* Remove default Posts type since NO BLOG LOL | |
* | |
* Remove Quick Draft Dashboard Widget | |
*/ | |
function mercs_remove_draft_widget(){ | |
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); | |
} | |
add_action( 'wp_dashboard_setup', 'mercs_remove_draft_widget', 999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment