Created
May 23, 2020 04:37
-
-
Save danielmcclure/4aead65fe6e472bd037b89ab7d365f75 to your computer and use it in GitHub Desktop.
Remove Post Links from WordPress Dashboard
This file contains hidden or 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 Sidebar | |
function m3_post_remove () { | |
remove_menu_page('edit.php'); | |
} | |
add_action('admin_menu', 'm3_post_remove'); //adding action for triggering function call | |
// Remove Posts from Admin Menu | |
function m3_remove_wp_nodes() { | |
global $wp_admin_bar; | |
$wp_admin_bar->remove_node( 'new-post' ); | |
} | |
add_action( 'admin_bar_menu', 'm3_remove_wp_nodes', 999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment