• Resolved dvpl

    (@dvpl)


    Hi,
    I have used wp_kses() function on the_content() as :

    echo wp_kses(get_the_content(), $allowed_html );

    According to need allowed tags are working fine except wordpress shortcode ex : [shortcode].

    shortcodes are printing as it is written in backend content area. I need them to work as usual.

    I need your valuable help.
    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter dvpl

    (@dvpl)

    Greetings!

    I found a solution and that is :
    Replace

    echo wp_kses(get_the_content(), $allowed_html );

    BY

    $content = wp_kses(get_the_content(), $allowed_html );
    echo do_shortcode($content);

    Thanks for the support.

Viewing 1 replies (of 1 total)

The topic ‘allow wordpress shortcode in wp_kses()’ is closed to new replies.