Created
July 10, 2013 08:52
-
-
Save sagarjadhav/5964589 to your computer and use it in GitHub Desktop.
Remove commment support from post, pages, admin menu and admin bar.
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 Comments Tab from admin menu */ | |
| function rtp_remove_admin_menus() { | |
| remove_menu_page('edit-comments.php'); | |
| } | |
| add_action('admin_menu', 'rtp_remove_admin_menus'); | |
| /* Remove commment support from post and pages */ | |
| function rtp_remove_comment_support() { | |
| remove_post_type_support('post', 'comments'); | |
| remove_post_type_support('page', 'comments'); | |
| } | |
| add_action('init', 'rtp_remove_comment_support', 100); | |
| /* Remove comment link from admin bar */ | |
| function rtp_admin_bar_render() { | |
| global $wp_admin_bar; | |
| $wp_admin_bar->remove_menu('comments'); | |
| } | |
| add_action('wp_before_admin_bar_render', 'rtp_admin_bar_render'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment