Make WordPress Core

Opened 5 years ago

Last modified 4 years ago

#49408 new enhancement

Why is the action wp_ajax_wp_link_ajax not using wp_send_json()

Reported by: stephanh's profile 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 5 years ago.

Download all attachments as: .zip

Change History (3)

@stephanh
5 years ago

#1 @sabernhardt
4 years ago

  • Keywords has-patch added

#2 @sabernhardt
4 years 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 4 years ago by sabernhardt (previous) (diff)
Note: See TracTickets for help on using tickets.