title: Disable access from url
body: <p>I wanna make custom post type "portfolio". So I had this code in args:</p>
  
  <pre><code>$args = array(
      'label'               =&gt; __( 'blabla', 'blabla' ),
      'description'         =&gt; __( 'blabla', 'blabla' ),
      'labels'              =&gt; $labels,
      'supports'            =&gt; array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'custom-fields' ),
      'hierarchical'        =&gt; false,
      'public'              =&gt; true,
      'show_ui'             =&gt; true,
      'show_in_menu'        =&gt; true,
      'taxonomies'          =&gt; 'category',
      'show_in_admin_bar'   =&gt; true,
      'show_in_nav_menus'   =&gt; false,
      'menu_position'       =&gt; 5,
      'menu_icon'           =&gt; 'dashicons-format-gallery',
      'can_export'          =&gt; true,
      'has_archive'         =&gt; true,
      'exclude_from_search' =&gt; false,
      'publicly_queryable'  =&gt; false,
      'query_var'           =&gt; 'portfolio',
      'rewrite'             =&gt; $rewrite,
      'capability_type'     =&gt; 'post',
  );
  </code></pre>
  
  <p>So everything is great but I wanna display portfolio items only at home page from php. After creating new portfolio item I can access it by link which Wordpress generates for me, but I want to disable this ability for all users. If it possible without redirects.</p>