Created
August 8, 2018 15:11
-
-
Save amorkovin/ea780be5a2d60c89a0762e0018ae5c6f to your computer and use it in GitHub Desktop.
Удалить ссылку с активного пункта меню
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// удаляем ссылку с активного пункта меню | |
function no_link_current_page($menu) { | |
return preg_replace('%((current-menu-item)[^<]+)[^>]+>([^<]+)</a>%', '$1<span class="current">$3</span>', $menu); | |
} | |
add_filter('wp_nav_menu', 'no_link_current_page'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment