Skip Navigation

Single apostrophes replaced with HTML entity when editing View output template

Open

Topic Tags: Views, Views plugin

Symptoms

After a recent WordPress update an issue has arisen when using the legacy editor for Views, specifically when the Loop Wizard has created a linked content template edited on the same page with the classic editor.

If—and only if–the user profile settings are set to “Disable the visual editor when writing” then single quotes (apostrophes) in the template are replaced by HTML entities.

Workaround

You can add the following code (e.g. to your theme functions.php) to override that setting:

add_action( 'current_screen', 'ts_fix_singlequotes' );
function ts_fix_singlequotes( $current_screen ){
	
	if ( $current_screen->base == "toolset_page_views-editor") {

		add_filter( 'user_can_richedit' , '__return_true', 50 );
	}
}

Leave
a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>