WordPress.org

Make WordPress Core

Opened 18 months ago

Last modified 8 months ago

#49408 new enhancement

Why is the action wp_ajax_wp_link_ajax not using wp_send_json()

Reported by: stephanh Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.3.2
Component: General Keywords: has-patch needs-testing
Focuses: coding-standards Cc:

Description

The action now returns an array with results with the header content-type text/html
Should this not be application/json as achieved by the wp_send_json() function?

https://core.trac.wordpress.org/browser/tags/5.3.2/src/wp-admin/includes/ajax-actions.php#L1863

Attachments (1)

49408.patch (382 bytes) - added by stephanh 18 months ago.

Download all attachments as: .zip

Change History (3)

@stephanh
18 months ago

#1 @sabernhardt
8 months ago

  • Keywords has-patch added

#2 @sabernhardt
8 months ago

  • Keywords needs-testing added

This could use some testing by someone who understands the functions better than I do :)

Next time, please create a patch from the root directory, but 49408.patch does apply to src.

The code for the wp_ajax_wp_link_ajax was added in 3.1 (changeset:16459), and wp_send_json was created for 3.5. So that's likely why it is not used yet.

Last edited 8 months ago by sabernhardt (previous) (diff)
Note: See TracTickets for help on using tickets.