Commit 34f2b9c
authored
Posts, Post Types: Fix missing array check in get_post_custom_values().
Posts, Post Types: Fix missing array check in get_post_custom_values().
`get_post_custom()` can return `false` for an invalid post ID or an empty
string for a non-existing post. `get_post_custom_values()` accessed the
result as an array without first verifying it is one, triggering a PHP
warning on PHP 8+.
Adds an `is_array()` guard consistent with the sibling function
`get_post_custom_keys()`, which already handles this case correctly.1 parent e12ddb3 commit 34f2b9c
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2891 | 2891 | | |
2892 | 2892 | | |
2893 | 2893 | | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
2894 | 2898 | | |
2895 | 2899 | | |
2896 | 2900 | | |
| |||
0 commit comments