HEX
Server: LiteSpeed
System: Linux server257.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: salhiscp (12590)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: /home/salhiscp/salhab360photos.com/wp-content/themes/acora/inc/WalkerMenu.php
<?php
/**
 * Extend native menu walker.
 *
 * @package acora
 * @since acora 1.0
 */

class WalkerMenu extends Walker_Nav_Menu{
	function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output){

		if(!isset($depth)){
			$depth = 0;
		}

		if(!$element) {
			return;
		}
		global $post;
		$id_field = $this->db_fields['id'];
		// Adds the "has-children" class to the current item if it has children.
		if(!empty($children_elements[$element->$id_field])) {
			array_push($element->classes, 'has-children');
		}
		// Call the default function to do the rest.
		return parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
	}
}