[wp-trac] [WordPress Trac] #17609: 'View post' link shown even when post type can't be viewed on the front-end

WordPress Trac noreply at wordpress.org
Wed Aug 27 01:33:37 UTC 2014


#17609: 'View post' link shown even when post type can't be viewed on the front-end
-------------------------------+-----------------------------
 Reporter:  scribu             |       Owner:  nacin
     Type:  defect (bug)       |      Status:  reopened
 Priority:  normal             |   Milestone:  Future Release
Component:  Posts, Post Types  |     Version:  2.9
 Severity:  normal             |  Resolution:
 Keywords:  has-patch          |     Focuses:
-------------------------------+-----------------------------

Comment (by johnbillion):

 It seems that the `publicly_queryable` argument has an identity crisis.
 What purpose does it serve to set this to a value which is different to
 that of `public`? Setting `publicly_queryable` to the opposite of `public`
 always results in broken behaviour. Example:
 {{{
 register_post_type( 'test', array(
         'show_ui'            => true,
         'public'             => true,
         'publicly_queryable' => false,
 ) );
 }}}
 The above code results in a post type with 'View' links throughout the
 admin area which, when clicked, result in a 404 because the post type is
 not publicly queryable.
 {{{
 register_post_type( 'test', array(
         'show_ui'            => true,
         'public'             => false,
         'publicly_queryable' => true,
 ) );
 }}}
 Conversely, the above code results in a post type without any 'View' links
 in the admin area, but a post type which is publicly queryable and which
 can be linked to.

 What is the use case for ever setting `publicly_queryable` to the opposite
 of `public`?

 In addition, the `publicly_queryable` argument for Pages is set to
 `false`, yet Pages are indeed publicly queryable. Has the purpose of this
 argument become confused?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/17609#comment:40>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list