Answer the question
In order to leave comments, you need to log in
How to compose a PHP regular expression so that the preg_replace function only handles exact matches?
It is necessary that the function
function no_link_current_page( $p ) {
return preg_replace( '%((current_page_item|current-cat)[^< ]+)[^>]+>([^< ]+)%', '$1$3', $p );
}
<li>
actions are also taking place on the class "current-cat-parent". I would like to avoid this
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question