Skip to content

Instantly share code, notes, and snippets.

@MattRyanCo
Created December 1, 2022 17:10
Show Gist options
  • Save MattRyanCo/35fc56fd178d466a316b87860d0012ef to your computer and use it in GitHub Desktop.
Save MattRyanCo/35fc56fd178d466a316b87860d0012ef to your computer and use it in GitHub Desktop.
Remove smart quote filtering on post title via wptexturize
if ( ! function_exists( 'text-domain_remove_title_wptexturize' ) ) {
/**
* Turn off WP default smart quote conversions in post title.
*/
function text-domain_remove_title_wptexturize() {
remove_filter( 'the_title', 'wptexturize' );
}
add_action( 'init', 'text-domain_remove_title_wptexturize' );
}
@MattRyanCo
Copy link
Author

Kudos to WebNots

@MattRyanCo
Copy link
Author

WP Ref: https://developer.wordpress.org/reference/functions/wptexturize/.
Disable the whole shebang: https://developer.wordpress.org/reference/hooks/run_wptexturize/
add_filter('run_wptexturize', '__return_false');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment