Advertisement
chrishajer

Hide "Add Form" icon for custom post type (REVISED)

Jul 3rd, 2014
839
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. // http://www.gravityhelp.com/forums/topic/remove-add-form-button-from-custom-post-type-edit-page
  3. add_action('admin_head', 'hide_add_form_icon');
  4. function hide_add_form_icon() {
  5.     global $post_type;
  6.     // edited July 3 2014 to fix PHP warnings
  7.     if ((isset($_GET['post_type']) && $_GET['post_type'] == 'directory') || ($post_type == 'directory')) {
  8.         echo "<style type='text/css'>a#add_gform {display:none;}</style>\n";
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement