Focus on cloud service provider activities
Notes on website operation and maintenance

Solve the problem that "&" in WordPress article content is escaped to "&"

Some of our friends use WordPress to build websites with HTML or programs, in which the&character will be escaped into the "&" character. Here, we certainly don't want to be escaped. How do we deal with it?

 //No escape symbol by laozuo.org add_filter( 'the_content', function( $string ) { return preg_replace_callback( '|]*)>(.*?)|', function( $matches ) { return ' . str_replace( '&', '&', $matches[1] ) . '>' . $matches[2] . ''; }, $ string ); }, 10, 1 );

 

Vote for you
Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Solve the problem that "&" in WordPress article content is escaped to "&"