[wp-trac] [WordPress Trac] #46723: Feature Image disappears only in Gutenberg with CPT.
WordPress Trac
noreply at wordpress.org
Fri Mar 29 22:20:47 UTC 2019
#46723: Feature Image disappears only in Gutenberg with CPT.
--------------------------+------------------------------
Reporter: miyauchi | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 5.1
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------------
Comment (by miyauchi):
I tried to check the user has `$post_type->cap->edit_post` capability for
the parent post type of the attachment.
But I run into the problem that the attachment possibly has another parent
post type like `page`.
I tried to add following lines in `check_update_permission()` and it looks
good.
{{{#!php
if ( 'attachment' === $post->post_type ) {
return current_user_can( 'upload_files' );
}
}}}
But I am concerned about introducing security risk.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46723#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list