WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#37897 closed enhancement (fixed)

Use the status parameter when sending JSON errors from the customizer

Reported by: johnbillion Owned by: westonruter
Milestone: 4.7 Priority: low
Severity: minor Version: 4.7
Component: Customize Keywords: has-patch
Focuses: Cc:
PR Number:

Description

[38422] introduced a $status_code parameter to the wp_send_json_error() function, among others.

The only place in core that currently sets a status code when calling wp_send_json_error() is in the customizer. Let's replace the manual calls to status_header() with this parameter.

Attachments (1)

37897.patch (1.8 KB) - added by johnbillion 3 years ago.

Download all attachments as: .zip

Change History (4)

@johnbillion
3 years ago

#1 @johnbillion
3 years ago

  • Keywords has-patch added

#2 @westonruter
3 years ago

  • Owner set to westonruter
  • Resolution set to fixed
  • Status changed from new to closed

In 38478:

Customize: Use new $status_code parameter for wp_send_json_error() instead of calling status_header() separately.

Props johnbillion.
See #35666.
Fixes #37897.

#3 @westonruter
3 years ago

Love it! 😍

Note: See TracTickets for help on using tickets.