There is a wordpress website with the idcommerce plugin installed in which there is a function to display the top menu.
add_action('after_setup_theme', 'idc_check_customizer'); function idc_check_customizer() { add_filter('wp_nav_menu_items', 'idc_update_menus', 10, 2); } function idc_update_menus($nav, $args) { global $permalink_structure; if (empty($permalink_structure)) { $prefix = '&'; } else { $prefix = '?'; } $durl = md_get_durl(); $location = $args->theme_location; $option = get_option('idc_menu_'.$location); if ($option) { do_action('idc_menu_before'); if (is_user_logged_in()) { $idc_menu = '<li class="createaccount buttonpadding"><a href="'.$durl.'">'.__('My Account', 'memberdeck').'</a></li>'; $idc_menu .= '<li class="login right"><a href="'.wp_logout_url( home_url() ).'">'.__('Logout', 'memberdeck').'</a></li>'; } else { $idc_menu = '<li class="createaccount buttonpadding"><a href="'.$durl.$prefix.'action=register">'.__('Create Account', 'memberdeck').'</a></li>'; $idc_menu .= '<li class="login right"><a href="'.$durl.'">'.__('Login', 'memberdeck').'</a></li>'; } do_action('idc_menu_after'); $nav .= apply_filters('idc_menu', $idc_menu); } return $nav; } I need to override the output of just one logina link ,
$idc_menu .= '<li class="login right"><a href="'.$durl.'">'.__('Login', 'memberdeck').'</a></li>'; replace the $ durl = / dashboard information panel link formed in a variable with the login page / login without replacing the output in the core of the plugin itself.
In functions.php if I delete an action
remove_action('after_setup_theme', 'idc_check_customizer'); and duplicate exactly the same filter, but with a link to / login , then it is displayed in the menu, but the left part of the menu, which belongs to the same nav, disappears. How to do everything right?