title: I want to hide add new from my custom post in wordpress but if posts are empty then enable add new
body: <p>Here is my code:</p>
  
  <pre><code>function wpmudev_create_slider_text() {
  $labels = array(
      'name' =&gt; 'sliderText',
      'singular_name' =&gt; 'Slider ',
      'add_new' =&gt; 'Add Text',
      'edit_item' =&gt; 'Edit Text',
      'view_item' =&gt; 'View Text',
      'search_items' =&gt; 'Search Products',
      'not_found' =&gt; 'No Products Found',
      'not_found_in_trash' =&gt; 'No Products found in Trash',
      'parent_item_colon' =&gt; '',
      'menu_name' =&gt; 'Slider Text',
  );
  
  register_post_type('product', array(
      'labels' =&gt; $labels,
      'has_archive' =&gt; true,
      'public' =&gt; true,
      'supports' =&gt; array('title', 'editor', 'excerpt', 'custom-fields', 'thumbnail', 'page-attributes'),
      'taxonomies' =&gt; array('post_tag', 'category'),
      'exclude_from_search' =&gt; false,
      'capability_type' =&gt; 'post',
      'capabilities' =&gt; array(
          'create_posts' =&gt; false,
      ),
      'map_meta_cap' =&gt; true,
      'rewrite' =&gt; array('slug' =&gt; 'sliderText'),
          )
  );
  
  
  }
  
  add_action('init', 'wpmudev_create_slider_text');
  </code></pre>
  
  <p>I want to hide add new if there is one active record if no active record(empty) then enable add new to insert one record</p>