Support » Plugin: Custom Menu Wizard Widget » Declaration of Custom_Menu_Wizard_Walker::walk

  • From WP 5.3 these warnings appear in the logs:

    PHP Warning: Declaration of Custom_Menu_Wizard_Sorter::walk($elements, $max_depth = 0) should be compatible with Walker::walk($elements, $max_depth, …$args) in /wp-content/plugins/custom-menu-wizard/include/class.sorter.php

    PHP Warning: Declaration of Custom_Menu_Wizard_Walker::walk($elements, $max_depth) should be compatible with Walker::walk($elements, $max_depth, …$args) in /wp-content/plugins/custom-menu-wizard/include/class.walker.php

    Looks like this solves it:
    class.walker.php line 55
    public function walk( $elements, $max_depth, …$args ){

    class.sorter.php line 60
    public function walk( $elements, $max_depth = 0, …$args ) {

    //NB : any orphan elements (and that includes children of orphans) get appended to the
    // output array in the order that they are placed in the original array (ie. regardless
    // of menu_order) BUT *only* if $max_depth is zero! If $max_depth is anything other than
    // zero then all orphans (and their children) are ignored (ie. discarded).
    $output = parent::walk( $elements, $max_depth, …$args );

    //always return an array…
    return is_array( $output ) ? $output : array();

    }

Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Declaration of Custom_Menu_Wizard_Walker::walk’ is closed to new replies.