Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi,

    The plugin does not change the titles, it requests them from WordPress via the get_the_title() function and prints it as-is.

    Do you use an advanced title field of some sort? Custom fields usually does not contain HTML tags, but often the values are rendered within the theme via custom codes.

    All the best,
    Ernest

    Thread Starter sam9023

    (@sam9023)

    Hi Ernest,

    I want to style rating using span tag it’s print span tag as plain text but before a month it was working properly I style rating using span tag

    Advance Title: {title} <span class=”rating”>{rating}</span>

    but now it’s printing this <span class=”rating”>{rating}</span> as plain text.

    Please, guide me how to style rating

    THANKS.

    Plugin Author wpdreams

    (@wpdreams)

    Thank you!

    I think I know what the issue is. In the most recent version there was a change regarding attribute escaping in the titles, which is incorrect.

    I will mark this as a possible bug and change it in the upcoming release.

    To resolve this, you either have to temporarily downgrade to the previous version or make a file change.

    If you want to make the file change, then open up wp-content/plugins/ajax-search-lite/includes/views/result.php file on your server, then find this line:

    <?php echo esc_html($r->title); ?>

    …and replace it with:

    <?php echo $r->title; ?>

    And that will do the trick.

    All the best,
    Ernest

    • This reply was modified 1 year, 3 months ago by wpdreams. Reason: Wrong line

    Ernest, thank you very much for posting such a clear answer, I updated from Version 4.11.2 to Version 4.12.5 and then I had this problem.

    I read this very post and edited the file as suggested and now I have this again

    It is a great plugin, thank you.

    Graham

    Plugin Author wpdreams

    (@wpdreams)

    Wonderful, then I will make sure to include this in the next release so you don’t have to worry about it anymore.

    If you like the plugin feel free to rate it, it’s greatly appreciated 🙂

    I will mark this topic as resolved now.

    All the best,
    Ernest

    Its safer to use

    <?php echo wp_kses_post($r->title); ?>

    which sanitizes content for allowed HTML tags for post content. More information about it on https://developer.ww.wp.xz.cn/reference/functions/wp_kses_post/

    Plugin Author wpdreams

    (@wpdreams)

    @k3nsai Thank you very much, I will test that, looks very promising.

    Expect a fix within a 2 days as soon as I’m back in office.

    Plugin Author wpdreams

    (@wpdreams)

    Just released 4.12.6, it uses the wp_kses_post method now for added safety. Thanks again for the suggestion @k3nsai

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Why span tag rendered as plain text’ is closed to new replies.