[wp-trac] [WordPress Trac] #36614: admin-ajax.php is not compatible with multisite
WordPress Trac
noreply at wordpress.org
Thu Apr 21 06:54:53 UTC 2016
#36614: admin-ajax.php is not compatible with multisite
--------------------------------+-----------------------------
Reporter: helium-3 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Networks and Sites | Version: 4.3
Severity: normal | Keywords:
Focuses: multisite |
--------------------------------+-----------------------------
I have noticed a major problem with admin-ajax.php on multisite.
admin-ajax.php works completely only for the primary blog
It seems like on mulisite admin-ajax.php is just a regular primary blog
page. You could use switch to blog, but it doesn't work completely. For
example $user->roles will return roles for the primary blog, even after
you switched. current_user_can_for_blog doesn't seem to work at all during
ajax call. The only way to check user roles for a specific blog is to
check usermeta.
But that's just if the plugin is active networkwide. What if the plugin is
active for a blog, other than primary? It won't fire at all in admin-
ajax.php . '''Meaning admin-ajax.php is unusable to plugins activated on a
blog other than primary.'''
WordPress needs to stop treating admin-ajax.php as if it was a primary
blog page. There should be a request parameter, like blog_id which would
tell which blog we are running request for.
I think this should be fixed asap in the next release. This basically
prevents writing plugins which should work on a specific blog of multisite
and use ajax.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36614>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list