[wp-trac] [WordPress Trac] #35666: Add support for HTTP response codes to wp_send_json_error(), wp_send_json_success(), and wp_send_json

WordPress Trac noreply at wordpress.org
Sun Aug 28 17:41:27 UTC 2016


#35666: Add support for HTTP response codes to wp_send_json_error(),
wp_send_json_success(), and wp_send_json
-------------------------+--------------------------
 Reporter:  johnbillion  |       Owner:  johnbillion
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:  4.7
Component:  Formatting   |     Version:  3.5
 Severity:  normal       |  Resolution:  fixed
 Keywords:  has-patch    |     Focuses:
-------------------------+--------------------------
Changes (by johnbillion):

 * owner:   => johnbillion
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"38422"]:
 {{{
 #!CommitTicketReference repository="" revision="38422"
 Formatting: Add a parameter to `wp_send_json_error()`,
 `wp_send_json_success()`, and `wp_send_json()` for specifying the HTTP
 response code.

 Defaults to `200` in all cases, but can be used, for example, to return a
 `403` when using `wp_send_json_error()`.

 Fixes #35666
 Props stephenharris
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35666#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list