[wp-trac] [WordPress Trac] #33763: Post types with show_ui set to false should not be accessible via the admin area
WordPress Trac
noreply at wordpress.org
Mon Nov 16 16:03:27 UTC 2015
#33763: Post types with show_ui set to false should not be accessible via the admin
area
----------------------------------+-----------------------------
Reporter: johnbillion | Owner: johnbillion
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 4.4
Component: Posts, Post Types | Version: 2.9
Severity: normal | Resolution:
Keywords: has-patch needs-docs | Focuses: administration
----------------------------------+-----------------------------
Changes (by nerrad):
* status: closed => reopened
* resolution: fixed =>
Comment:
I have another issue that likely wasn't forseen.
In our case we want `show_ui` set to false so it restricts access to the
native post_editor for our custom post type. However, we were using the
`get_edit_post_link` filter to filter the edit links to point to our
custom ui for editing our post type.
The problem is that with the change introduced here, if `show_ui` is set
to false, not only does it restrict access to the native editor (huge plus
by the way) but it also prevents the edit links from being shown.
Currently the only way to rectify that is to set `show_ui` to true.
I see that this is because of this bit of code:
{{{
$allowed = array_merge( array(
'revision',
), get_post_types( array(
'show_ui' => true,
) ) );
}}}
Would it be possible to make that allowed array filterable, then plugins
can still show the edit link when they have a custom ui. It *might* even
be a place where we could add another argument on the register_post_type
array for this explicit scenario?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33763#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list