[wp-trac] [WordPress Trac] #43347: Introduction of 'has_single' register_post_type parameter
WordPress Trac
noreply at wordpress.org
Sun Feb 18 18:28:47 UTC 2018
#43347: Introduction of 'has_single' register_post_type parameter
-------------------------------+-----------------------------
Reporter: stevepuddick | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version:
Severity: normal | Keywords:
Focuses: template |
-------------------------------+-----------------------------
I have done some research but have not been able to find anything exactly
on this issue.
I frequently encounter use cases where I need to create a CPT with the
following characteristics:
1) disable the slug display/editor from the admin post edit page (this is
for usability. It is not used and having it available/displayed can
confuse website editors)
2) maintain the archive page is viewable on the front end
3) disable the single page for the CPT on the front end
I have found some partial solutions like this
https://wordpress.stackexchange.com/questions/128636/how-to-disable-the-
single-view-for-a-custom-post-type but setting `'publicly_queryable' =>
false` would disable the archive view.
The `register_post_type` function includes the `has_archive` parameter. Is
it possible to introduce a `has_single` parameter which will achieve the
desired functionality stated above?
I feel this can be beneficial in many cases, to the extent it is
worthwhile introducing as a core feature.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43347>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list