Make WordPress Core

Changeset 39949


Ignore:
Timestamp:
01/24/2017 11:28:13 PM (7 years ago)
Author:
peterwilsoncc
Message:

Menus: Prevent notice thrown in class-walker-page.php.

Calling Walker_Page::walk() directly was causing an Undefined index: item_spacing notice to be thrown, this adds an isset() check to prevent it.

Props bhargavbhandari90.
Fixes #39564.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-walker-page.php

    r39051 r39949  
    5454     */
    5555    public function start_lvl( &$output, $depth = 0, $args = array() ) {
    56         if ( 'preserve' === $args['item_spacing'] ) {
     56        if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
    5757            $t = "\t";
    5858            $n = "\n";
     
    7979     */
    8080    public function end_lvl( &$output, $depth = 0, $args = array() ) {
    81         if ( 'preserve' === $args['item_spacing'] ) {
     81        if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
    8282            $t = "\t";
    8383            $n = "\n";
     
    104104     */
    105105    public function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) {
    106         if ( 'preserve' === $args['item_spacing'] ) {
     106        if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
    107107            $t = "\t";
    108108            $n = "\n";
     
    197197     */
    198198    public function end_el( &$output, $page, $depth = 0, $args = array() ) {
    199         if ( 'preserve' === $args['item_spacing'] ) {
     199        if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
    200200            $t = "\t";
    201201            $n = "\n";
Note: See TracChangeset for help on using the changeset viewer.