Last active
January 25, 2017 13:12
-
-
Save pdewouters/4526457 to your computer and use it in GitHub Desktop.
Remove the 'View' link from the admin bar for a custom post type
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
/** | |
* removes the 'view' link for CPT in the admin bar | |
*/ | |
function pdw_admin_bar_render() { | |
global $wp_admin_bar; | |
if('client' == get_post_type()){ | |
$wp_admin_bar->remove_menu('view'); | |
} | |
} | |
add_action( 'wp_before_admin_bar_render', 'pdw_bij_admin_bar_render' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment