[wp-trac] [WordPress Trac] #40340: "Attach to existing content" modal shows posts and pages of other users
WordPress Trac
noreply at wordpress.org
Tue Apr 4 13:31:51 UTC 2017
#40340: "Attach to existing content" modal shows posts and pages of other users
-----------------------------+------------------------------
Reporter: menakas | Owner:
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: Awaiting Review
Component: Role/Capability | Version: 4.7.3
Severity: normal | Resolution:
Keywords: has-screenshots | Focuses: ui
-----------------------------+------------------------------
Comment (by subrataemfluence):
Yes, that's true. But when listing posts in popup why should I loop
through all posts to find out what posts the 'current_user_can' edit?
Don't you think it creates overhead if there are say 5000 posts and WP has
to go though all of them in order to just decide whether or not to place
it in the popup?
This should be checked when the action is being performed, i.e. attaching
a media to a post which the current_user_can NOT edit (as per the issue
reported here), and I believe this is how it is working now.
The issue as reported here is to filter out only "user's own posts" in the
popup when somebody clicks on Attach link of a specific media. So if that
has to be achieved `current_user_can` check needs to check every single
post available in the database. I believe this is an extra burden. I may
be wrong!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40340#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list