Last active
January 6, 2019 17:10
-
-
Save Korveld/5bbf0fa73ac61f22fd724c6ba72f5627 to your computer and use it in GitHub Desktop.
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
function disable_new_posts() { | |
// Hide sidebar link | |
global $submenu; | |
unset($submenu['edit.php?post_type=CUSTOM_POST_TYPE'][10]); | |
// Hide link on listing page | |
if (isset($_GET['post_type']) && $_GET['post_type'] == 'CUSTOM_POST_TYPE') { | |
echo '<style type="text/css"> | |
.page-title-action { display:none; } | |
</style>'; | |
} | |
} | |
add_action('admin_menu', 'disable_new_posts'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment