Opened 14 years ago
Closed 14 years ago
#23272 closed defect (bug) (fixed)
Notice on class-wp-walker.php
| Reported by: | rodrigosprimo | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.6 |
| Component: | Warnings/Notices | Version: | 2.7 |
| Severity: | normal | Keywords: | has-patch commit dev-reviewed |
| Cc: | Focuses: |
Description
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[0] ) )
$args[0]['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.
Attachments (2)
Change History (6)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Patch