[wp-trac] [WordPress Trac] #46866: Introduce the 'Uploaded to' onto the Full Media Editor

WordPress Trac noreply at wordpress.org
Fri Oct 9 14:16:30 UTC 2020


#46866: Introduce the 'Uploaded to' onto the Full Media Editor
-------------------------------------------------+-------------------------
 Reporter:  garrett-eclipse                      |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  5.6
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-screenshots needs-     |     Focuses:  ui,
  testing needs-design-feedback                  |  administration
-------------------------------------------------+-------------------------

Comment (by Mista-Flo):

 Replying to [comment:21 SergeyBiryukov]:
 > Just a quick note that the latest patch appears to remove some checks
 from `wp_prepare_attachment_for_js()`:
 > * `$parent_type && $parent_type->show_ui`
 > * `current_user_can( 'edit_post', $attachment->post_parent )`
 >
 > At a glance, these are still relevant to avoid displaying a link that
 should not be displayed if the parent post type doesn't have a UI or the
 current user cannot edit the parent post.
 >
 > Would be good to test and verify that removing these does not lead to
 any unexpected results, e.g. displaying a link leading to nowhere, or PHP
 notices when the post type no longer exists.
 Hi Sergey,

 `get_edit_post_link( $attachment->post_parent, 'raw' );` is actually doing
 capability check, returns an empty string if the user does not have the
 cap. Then in the template, we have the `<# if ( data.uploadedToLink ) {
 #>`.

 So I think it was extra capabilities that are not useful anymore, we can
 clean the code, what do you think?

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


More information about the wp-trac mailing list