[wp-trac] [WordPress Trac] #46866: Introduce the 'Uploaded to' onto the Full Media Editor
WordPress Trac
noreply at wordpress.org
Mon Aug 31 22:06:19 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 garrett-eclipse):
Thanks @Mista-Flo, to my understanding `get_edit_user_link` does the
capability check for us;
{{{
if ( empty( $user_id ) || ! current_user_can( 'edit_user', $user_id ) ) {
}}}
Source - https://github.com/WordPress/wordpress-
develop/blob/81a12a7bec6f82bb681176555308335822bd4010/src/wp-includes
/link-template.php#L1625
The author was available already so the above check in
`get_edit_user_link` means the link will only be made available if they
have the edit_user capability.
That being said I do encourage testing on the capabilities to make sure
we've not overlooked something.
And now looking at `get_edit_post_link` we can maybe save on the
conditional in your original code, before grabbing the link from that
function, as it already does a check on `edit_post` capability;
https://github.com/WordPress/wordpress-
develop/blob/81a12a7bec6f82bb681176555308335822bd4010/src/wp-includes
/link-template.php#L1378
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46866#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list