Friday, June 3, 2022
HomeWordPress Developmentcustomization - filter higher and decrease case characters in Auto tag...

customization – filter higher and decrease case characters in Auto tag hyperlink code?


enter image description here
Query:
How one can filter uppercase and lowercase when the phrase ‘tag’ is written in lowercase?

and vice versa, filter the phrase ‘tag’ which is written in capital letters?

This is the code I acquired from a plugin that hasn’t been up to date in just a few years.

perform auto_link_tags($content material){

//$post_id = get_the_ID();
$post_tags = get_the_tags();

if ($post_tags) {
    $i = 0;
    foreach($post_tags as $tag) $)))b~i";
        $tag_url = get_tag_link($tag->term_id);
        $tag_html[$i] = '<a href="' . $tag_url . '" title="$1">$1</a>';
        $i++;
    
    $content material = preg_replace($tags, $tag_html, $content material);
}

return $content material;}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments