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. git-svn-id: https://develop.svn.wordpress.org/trunk@39949 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
cf0ca2645f
commit
6de7c69c0d
|
@ -53,7 +53,7 @@ class Walker_Page extends Walker {
|
|||
* Default empty array.
|
||||
*/
|
||||
public function start_lvl( &$output, $depth = 0, $args = array() ) {
|
||||
if ( 'preserve' === $args['item_spacing'] ) {
|
||||
if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
|
||||
$t = "\t";
|
||||
$n = "\n";
|
||||
} else {
|
||||
|
@ -78,7 +78,7 @@ class Walker_Page extends Walker {
|
|||
* Default empty array.
|
||||
*/
|
||||
public function end_lvl( &$output, $depth = 0, $args = array() ) {
|
||||
if ( 'preserve' === $args['item_spacing'] ) {
|
||||
if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
|
||||
$t = "\t";
|
||||
$n = "\n";
|
||||
} else {
|
||||
|
@ -103,7 +103,7 @@ class Walker_Page extends Walker {
|
|||
* @param int $current_page Optional. Page ID. Default 0.
|
||||
*/
|
||||
public function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) {
|
||||
if ( 'preserve' === $args['item_spacing'] ) {
|
||||
if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
|
||||
$t = "\t";
|
||||
$n = "\n";
|
||||
} else {
|
||||
|
@ -196,7 +196,7 @@ class Walker_Page extends Walker {
|
|||
* @param array $args Optional. Array of arguments. Default empty array.
|
||||
*/
|
||||
public function end_el( &$output, $page, $depth = 0, $args = array() ) {
|
||||
if ( 'preserve' === $args['item_spacing'] ) {
|
||||
if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
|
||||
$t = "\t";
|
||||
$n = "\n";
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue