WordPress.org

Make WordPress Core

Opened 7 months ago

Last modified 7 months ago

#22589 new enhancement

Network Admin + Ajax requests

Reported by: dd32 Owned by:
Priority: normal Milestone: Awaiting Review
Component: Administration Version:
Severity: normal Keywords:
Cc: info@…

Description

Currently there is no Network admin based ajax handler, forcing plugins which exist solely within the Network Admin to either use wp-admin/admin-ajax.php or using the load-{$page_hook} hook to perform any actions.

This is primarily a problem when the plugin only includes code on a conditional such as is_network_admin(), which would be false for a /wp-admin/admin-ajax.php request, as a result, only the load-{$page_hook} option above is viable for those.
As a work around, plugins can include code on is_network_admin() || DOING_AJAX to allow the usage of admin-ajax.php.

Of course, the User Admin also suffers the same issue.

I didn't see any previous tickets, and kind of want to say the existing 'workaround' is appropriate, but recording it here so we can at least close it as wontfix if appropriate.

Change History (2)

comment:1 toscho7 months ago

  • Cc info@… added

comment:2 scribu7 months ago

  • Type changed from feature request to enhancement

I don't think the workaround is appropriate; it's a hack.

We should have a dedicated /wp-admin/network/admin-ajax.php file, which contains all the network-specific ajax handlers.

Note: See TracTickets for help on using tickets.