forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General: Handle missing field in WP_List_Util::pluck().
Handles when the `$field` (i.e. key or property) is missing in one of the `$input_list` items by checking the key (array) or property (object) exists before using it for assignment. Resolves the following bugs: * a PHP warning for undefined key|property. * `null` being set for that array or object within the returned list. The changes resolve the issues in both `WP_List_Util::pluck()` (if invoked directly) and `wp_list_pluck()`. Also includes an additional test for the scenario where the `wp_list_pluck()` `$index_key` is not `null`, the `$field` is missing in one of the `$input_list` items. Follow-up to [55423], [51663], [42527], [38928]. Props iamarunchaitanyajami, davidbinda, hellofromTonya, helgatheviking. Fixes #59774. git-svn-id: https://develop.svn.wordpress.org/trunk@57698 602fd350-edb4-49c9-b593-d223f7449a82
- Loading branch information
1 parent
ec459dc
commit 8448d06
Showing
2 changed files
with
68 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters