FAQ: How to disable character replacement?

This is the right place to report general bugs, make suggestions or ask for help.
Post Reply
User avatar
FlatPress Coder
Posts: 399
Joined: Sat Jan 26, 2019 7:40 pm

FAQ: How to disable character replacement?

Post by Arvid » Wed Dec 25, 2019 3:40 pm

Default behaviour
By default, FlatPress replaces some characters (or character combinations) within your entries and static pages:
  • Two hyphens ("--") become an en dash ("–"), three an em dash ("—")
  • Three dots become an ellipsis ("…")
  • Quotations marks: "text" will become “test”
  • Trademark sign: "Text (tm)" is being replaced with "Text ™"
  • Multiplication sign: "2x3" is displayed as "2×3"
... and a few more.

How to disable
If you would like FlatPress not to do these character replacements, just tell it to :)
After the first three lines of your index.php, just add the highlighted line:
include 'defaults.php';
include INCLUDES_DIR . 'includes.php';
include SMARTY_DIR . 'SmartyValidate.class.php';

remove_filter('the_content', 'wptexturize');

define('MOD_INDEX', 1);


More details
The described replacements take place in the function wptexturize() in fp-includes/core/core.wp-formatting.php. Please refer there for a detailled view into the replacement logic.
Helpful FlatPress links: Project blog 📝 - FlatPress wiki 📖 - FlatPress@Twitter 🐦 - FlatPress@Mastodon 🐘
Stay up to date with our feeds: Forum RSS feed 📜 - Project blog RSS feed 📜
Feel free to say Thank you: Donate ❤️

🇩🇪 Für meinen Arbeitgeber in Bochum habe ich zwei Stellen zu besetzen: Junior-Systemadministrator, Ausbildung zum Fachinformatiker Systemintegration 🇩🇪

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest