Notice on class-wp-walker.php
|Reported by:||rodrigosprimo||Owned by:||SergeyBiryukov|
|Component:||Warnings/Notices||Keywords:||has-patch commit dev-reviewed|
When using the Walker class I get the following notice:
Notice: Undefined offset: 0 in wp-includes/class-wp-walker.php on line 126
//display this element if ( is_array( $args ) ) $args['has_children'] = ! empty( $children_elements[$element->$id_field] );
If I'm not mistaken, this problem is happening because the code assumes that the $args variable is always a non empty array which is not the case.
I'm attaching the code I used to reproduce the problem and a patch to fix it.
Change History (6)
comment:2 SergeyBiryukov — 14 months ago
- Milestone changed from Awaiting Review to 3.6
- Version changed from trunk to 2.7