[wp-trac] [WordPress Trac] #59630: wp_json_encode(): rename parameters for parity with PHP Core

WordPress Trac noreply at wordpress.org
Tue Nov 21 00:23:17 UTC 2023


#59630: wp_json_encode(): rename parameters for parity with PHP Core
--------------------------+-------------------------------
 Reporter:  jrf           |       Owner:  SergeyBiryukov
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  6.5
Component:  General       |     Version:  4.1
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:  coding-standards
--------------------------+-------------------------------
Changes (by SergeyBiryukov):

 * owner:  (none) => SergeyBiryukov
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"57130" 57130]:
 {{{
 #!CommitTicketReference repository="" revision="57130"
 General: Rename `wp_json_encode()` parameters for parity with PHP Core.

 `wp_json_encode()` is a wrapper for the PHP native `json_encode()`
 function with some extra safety checks.

 This commit renames the `$data` parameter in the `wp_json_encode()`
 function and associated functions to `$value`, and the `$options`
 parameter to `$flags` for parity with the parameter names used in PHP
 Core.

 Reference: [https://www.php.net/manual/en/function.json-encode.php PHP
 Manual: json_encode()].

 Follow-up to [30055].

 Props jrf, hellofromTonya.
 Fixes #59630.
 }}}

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


More information about the wp-trac mailing list