Commit 7682e9a
committed
Menus: Ensure a
The `get_post_states()` function is also hardened to short-circuit in case a non-`WP_Post` is passed. A test is added to verify this.
Developed in #10706
Follow-up to [47211].
Props apedog, josephscott, joemcgill, westonruter.
See #49374.
Fixes #58932.
git-svn-id: https://develop.svn.wordpress.org/trunk@61465 602fd350-edb4-49c9-b593-d223f7449a82WP_Post instance gets passed to get_post_states() in wp_setup_nav_menu_item().1 parent fd35afa commit 7682e9a
File tree
3 files changed
+26
-4
lines changed- src
- wp-admin/includes
- wp-includes
- tests/phpunit/tests/admin
3 files changed
+26
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2296 | 2296 | | |
2297 | 2297 | | |
2298 | 2298 | | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
2299 | 2303 | | |
2300 | 2304 | | |
2301 | 2305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
875 | 875 | | |
876 | 876 | | |
877 | 877 | | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
882 | 884 | | |
883 | 885 | | |
884 | 886 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
497 | 513 | | |
0 commit comments