Cannot process strings programmatically…?
-
Hi there,
first of all: What a great plugin, many many thanks for creating and maintaining it!
I encountered an issue where I could use some advice…
I am trying to filter / process a string in order to add hyphenation but cannot get it to work. I double-checked already that a) no other filtering is happening which could remove the
­
-tags and b) that the function calls are working fine and c) the user settings are correctly set.So essentially this is my demo code:
if(class_exists('WP_Typography')) { $s = \WP_Typography::get_user_settings(); $title_with_big_words = 'Bei Profis und Amateuren gleicherma?en beliebtes Leinenschl?ppchen mit geteilter Sohle'; $hyphenated_title = \WP_Typography::process_title($title_with_big_words, $s); echo $hyphenated_title; }
And this is what I am getting:
Bei Profis und Amateuren gleicherma?en beliebtes Leinenschl?ppchen mit geteilter Sohle
But I would expect to see:
Bei Pro­fis und Ama­teu­ren glei­cher­ma­?en belieb­tes Lei­nen­schl?pp­chen mit geteil­ter Soh­le
What could be the culprit here?
I can var_dump the settings object just fine and wp-typogrophy definitely works because the content filtering is happening and I am seeing the
­
-tags there just fine.Using WP 5.9 with the latest plugin version.
Thanks for any help regarding further debugging this!
- The topic ‘Cannot process strings programmatically…?’ is closed to new replies.