Support » Plugins » Hacks » Remove unwanted BR linebreak after tag

  • Resolved DLpres



    This is a straight follow-up to which has been closed.

    I have the exact same issue, something is adding breaks after </label> tags. The affected code is part of Store Locator Plus plugin, I found the relevant part in the plugin that generates this HTML code and there’s definitely no
    in there.

    I tried the remove_bad_br_tags function hook mentioned in the thread; I verified that it works for replacing other kinds of text in the document but it doesn’t see the </label> tag. Basically
    $content = str_ireplace("</label>", "foobar", $content);
    doesn’t do anything.

    The offending page is Search for “Radius</label>


Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz


    Returned values from ‘the_content’ filter are almost immediately echoed out to the browser. The only way $content could end up differently than what your filter function returns is if a different filter hooked to ‘the_content’ is also altering content. You might try adding a high numbered 3rd parameter to your add_filter() call in an attempt to get your filter to be applied last.

    You may gain insight to what other filters are involved by doing a var_dump() on the global $wp_filter array which contains all filter function references.

    It’s working, thanks!!

    My PHP skills are rudimentary but I was able to execute a var_dump. There are 9 other filters hooking to “the_content”. Looks like the culprit is “theme_formatter” from my Striking theme, which has priority=99.

    Once I set a higher priority my filter worked as intended.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove unwanted BR linebreak after tag’ is closed to new replies.