$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Display html code, not the tags|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Display html code, not the tags

matteradmin7PV0评论

I am using a theme and I want to modify it in order to use html code in a text field.

This is the part of the code that renders this field:

do_shortcode( wpautop( esc_html( $sectionData['left-content'] ) ) )

I want to modify it in order to display html code properly, but it keeps rendering the tags and not the formatted text.

I want to display this but it displays <b>this</b>. How I can modify it?

I am using a theme and I want to modify it in order to use html code in a text field.

This is the part of the code that renders this field:

do_shortcode( wpautop( esc_html( $sectionData['left-content'] ) ) )

I want to modify it in order to display html code properly, but it keeps rendering the tags and not the formatted text.

I want to display this but it displays <b>this</b>. How I can modify it?

Share Improve this question asked Mar 3, 2019 at 10:00 netdevnetdev 1052 silver badges6 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You need to remove the esc_html(). The whole purpose of that function is to prevent text being interpreted as HTML.

do_shortcode( wpautop( $sectionData['left-content'] ) );

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far