db_fields = $fields; } } /** * Starts the list before the elements are added. * * @see Walker_Nav_Menu::start_lvl() * * @since 3.0.0 * * @param string $output Passed by reference. Used to append additional content. * @param int $depth Depth of page. Used for padding. * @param array $args Not used. */ public function start_lvl( &$output, $depth = 0, $args = array() ) { $indent = str_repeat( "\t", $depth ); } /** * Ends the list of after the elements are added. * * @see Walker_Nav_Menu::end_lvl() * * @since 3.0.0 * * @param string $output Passed by reference. Used to append additional content. * @param int $depth Depth of page. Used for padding. * @param array $args Not used. */ public function end_lvl( &$output, $depth = 0, $args = array() ) { $indent = str_repeat( "\t", $depth ); } /** * Start the element output. * * @see Walker_Nav_Menu::start_el() * * @since 3.0.0 * * @global int $_nav_menu_placeholder * * @param string $output Passed by reference. Used to append additional content. * @param object $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. * @param array $args Not used. * @param int $id Not used. */ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { global $_nav_menu_placeholder; global $gloable_all_author_array; global $gloable_all_template_array; global $gloable_all_category_array; global $gloable_all_current_menu_id; $recently_edited = absint( get_user_option( 'nav_menu_recently_edited', get_current_user_id()) ); if(!empty($recently_edited)){ $menu_items = wp_get_nav_menu_items($recently_edited); if(isset($menu_items) && !empty($menu_items)) { for ( $amm=0; $amm < count($menu_items); $amm++ ) { $gloable_all_current_menu_id[] = $menu_items[$amm]->object_id; } } } // set all template globaly $get_templates_all = get_page_templates(); foreach ( $get_templates_all as $template_name => $template_filename ) { $gloable_all_template_array[$template_name] = $template_filename; } $current_menu_post_id = $gloable_all_current_menu_id; $cate_array = array(); $cate_id_array = array(); $current_post_category = ''; $allready_menu_class=''; if(empty($item->front_or_home) && empty($item->term_id) && !empty($item->post_author)) $post_author_name = get_the_author_meta('display_name',$item->post_author); $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1; //phpcs:ignore $possible_object_id = isset( $item->post_type ) && 'nav_menu_item' === $item->post_type ? $item->object_id : $_nav_menu_placeholder; $possible_db_id = ( ! empty( $item->ID ) ) && ( 0 < $possible_object_id ) ? (int) $item->ID : 0; $possible_db_id = $item->ID; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $chiled_dash = ''; if(is_array($current_menu_post_id) && count($current_menu_post_id) >= 1 ){ if (in_array( ( string ) $item->object_id, $current_menu_post_id, true)) { $allready_menu_class = " menu_exists";} } if(!empty($indent)){ $output .= $indent . '