The error was observed with German locale (‘de’).
Expected behavior:
echo wptexturize('"Test"'); // \&\#8222;Test\&\#8220; => ?Test“
echo wptexturize('"<a>Test</a>"'); // \&\#8222;<a>Test</a>\&\#8220; => ?Test“ (with hyperlink)
Observed behavior:
echo wptexturize('"Test"'); // \&\#8222;Test\&\#8220; => ?Test“
echo wptexturize('"<a>Test</a>"'); // \&\#8222;<a>Test</a>\&\#8222; => ?Test? (with hyperlink)
The change is in the last line, the last character: After the closing tag the closing double quotation mark is replaced by the wrong character.
]]>So I have tested on a brand new install of WordPress 5.8.2.
No plugins or themes have been installed.
No content added, it is a barebones new WP install.
Is this usual? Is there a way for it to not use the code format?
]]>there seems to be a problem when adding secondary titles to posts with (some?) special characters in the title. The secondary title won’t get auto shown.
For me the problem occurred in a post with the title Mai & Juni 2021
.
By adding some debug output to function secondary_title_auto_show in hooks.php I identified the validate secondary title check as the problem’s cause.
This is my debug output:
$title: Mai & #038 ; Juni 2021 [without spaces in the ampersand code]
wptexturize( $post->post_title ): Mai & Juni 2021
$title !== wptexturize( $post->post_title ): 1
In $title
the ampersand is encoded while wptexturize(...)
returns it non encoded. The comparison is true and $standard_title
is returned instead of applying the secondary title.
For fixing my problem I added passing $title
through htmlspecialchars_decode()
. This converts & #038 ;
(without spaces) back to &
.
But will it work for the titles you had in mind when adding this condition?
Maybe you could take my fix for the next version of your plugin or find a better way to make work auto showing of secondary titles in posts with special characters in the title.`
]]>"A title with <em>italics</em> and quotes"
However, if I have this content in a page title:
"A title with quotes and <em>italics</em>"
the first double quote is correctly converted to an opening double quote, but the last double quote is incorrectly converted to opening double quote (i.e. a 66 and not a 99).
It seems that if the title ends with a ‘>’ the smart quotes function is not working. Can anyone replicate this – is it a bug?
]]>Thanks.
]]></p>
tags, instead of writing everything in one line. This repeats when switching between the visual and text tab, and the so generated empty lines get converted into <p> </p>
every time.
I’ve tried to fix it with remove_filter( 'widget_text_content', 'wpautop' );
and remove_filter( 'widget_text_content', 'wptexturize' );
in my custom themes, but had no success. Tested with WordPress 5.3, Twenty twenty theme and no other plugins active too – still an issue.
As I’m using this plugin on every WordPress installation since about 8 years and had no problems instead of that, I would love to get rid of that issue. Maybe a good reason to remove that “not updated in 4 years” notice too? =)
Edit: I’ve set the “new line on enter” setting to paragrahps btw.
]]>I just did a domain remap to make my website go live and I now have this error in the log file:
[07-Mar-2019 12:24:05 UTC] PHP Fatal error: Cannot redeclare wptexturize() (previously declared in /home2/olstacor/public_html/wp-includes/formatting.php:51) in /home2/olstacor/public_html/wp-includes/formatting.php on line 315
What could this be. I have tried to reinstall the plugin with no luck.
]]>the plugin seems to break the functionality of wptexturize(). I noticed on my German websites that quote marks are not being converted to language specific versions if the plugin is activated. This is true for all fields where I speficically use wptexturize() (“the_title”, “the_content”, custom fields).
WP Version: 5.0.2
Kind Regards
Stefan