• Resolved PNP

    (@itsmepnp)


    This plugin is super cool, However, I have encountered a problem with texts on the interactive banner, It doesn’t allow basic html like <a><i><br/> Is there any quick fix, I tried wp_kses but doesn’t seem to work, maybe I’m doing it wrong. Can you help?

    • This topic was modified 6 years, 4 months ago by PNP.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Nenad Obradovic

    (@nenad-obradovic)

    Hi itsmepnp,

    Thank you ?

    This is happened because I escaped all text in shortcodes with esc_html function to prevent malicious code and for the security. But if you want to change that, just go inside plugin folder/shortcodes/interactive-banner/templates and find text part of code and insted of esc_html fill wp_kses($text, array(‘br’ => true, ‘a’ => array(‘href’ => true)));

    I hope this helps you.

    Best regards,
    Nenad

    Plugin Author Nenad Obradovic

    (@nenad-obradovic)

    Hi,

    Right location extensive-vc/shortcodes/interactive-banner/templates/parts/text.php

    <?php echo esc_html( $text ); ?>

    replace with this

    <?php echo wp_kses( $text, array( 'br' => true, 'a' => array( 'href' => true ) ) ); ?>

    Best regards,
    Nenad

    Thread Starter PNP

    (@itsmepnp)

    Wow, that was quick.
    I thought I exactly did like above. Anyway thanks a lot, It’s working now.
    Wish this plugin is a massive hit, It is really good.

    Plugin Author Nenad Obradovic

    (@nenad-obradovic)

    Hi itsmepnp,

    You are welcome ? Thanks for these kinds of words

    Best regards,
    Nenad

    Thread Starter PNP

    (@itsmepnp)

    I’m back with same problem ,
    I want to add a icon that is linked with my social account . shouldn’t
    <?php echo wp_kses( $text, array( 'br' => true, 'i' => true, 'a' => array( 'href' => true ) ) ); ?> do the job.
    code is simple like <a target="_blank" href="https://www.instagram.com/#"><i class="fa fa-instagram"></i></a>.

    Plugin Author Nenad Obradovic

    (@nenad-obradovic)

    Hi,

    Try to modify your code with this
    <?php echo wp_kses( $text, array( 'br' => true, 'i' => array( 'class' => true ), 'a' => array( 'href' => true, 'target' => true ) ) ); ?>

    Or you can try this one
    <?php echo wp_kses_post( $text ); ?>

    Or this code without escaping function
    <?php echo $text; ?>

    Best regards,
    Nenad

    • This reply was modified 6 years, 4 months ago by Nenad Obradovic. Reason: Code fix
    Thread Starter PNP

    (@itsmepnp)

    Thanks again, Looks like the theme we are using is causing the problem.
    Previous code worked but once we updated WordPress core and all plugins (including this, I think) it stopped working.
    This code works perfectly fine in another theme. sorry for the trouble.

    • This reply was modified 6 years, 4 months ago by PNP.
    Plugin Author Nenad Obradovic

    (@nenad-obradovic)

    Hi itsmepnp,

    You are welcome, if you need anything else be free to contact me. ?

    Best regards,
    Nenad

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘allow html in text’ is closed to new replies.