Hi, We’ve encountered an issue with how taxonomy terms are being handled in our pages for the Arabic language. Specifically, when a taxonomy term consists of two or more words, they are not joined together properly with an underscore (_). For example, the Arabic term “تصنيف جديد” should be transformed into “تصنيف_جديد” (with underscores connecting the words). Could you please update the logic to ensure that multi-word taxonomy terms in Arabic are joined together using an underscore (_) Or Provide us the file or configuration location where this logic is implemented to adjust it ? Thank you
This topic was modified 4 months, 1 week ago by charbi.
This topic was modified 4 months, 1 week ago by charbi.
The Plugin will remove spaces in Categories, without replacing them with an underscore, and append a hashtag before the Category. This is default behaviour, by design at the request of many users.
Thank you for your reply. I have been working with the solution provided to handle taxonomy terms in Arabic. I’ve applied the wp_to_buffer_publish_parse_text_term_hashtag filter to modify the term names and replace spaces with underscores. Unfortunately, the issue persists, and the desired outcome has not been achieved. The problem is noticeable with Arabic taxonomy terms that consist of two or more words. When such terms are processed, they are treated as a single, continuous string without any spaces or underscores between the words, which causes the terms to become meaningless. For example, the Arabic term “تصنيف جديد” should be transformed into “تصنيف_جديد” to maintain its meaning. However, with the current setup, the term is concatenated into something like “تصنيفجديد”, which is not only incorrect but also causes confusion and loss of meaning. It is crucial that the words in these terms be separated by underscores to preserve their meaning, especially in Arabic, where spaces between words hold significant importance. Without this modification, the terms are effectively useless when shared through Buffer. I hope there is a solution to this issue, and I would greatly appreciate your assistance in resolving it.
Here is the code I applied in my functions.php file: add_filter('wp_to_buffer_publish_parse_text_term_hashtag', function ($term, $taxonomy) { // Replace spaces with underscores in all taxonomy terms $term = str_replace(' ', '_', $term); return $term; }, 10, 2); Despite this, the taxonomy terms are still being concatenated without the underscore _. For example: • A term like “تصنيف جديد” is still output as “تصنيفجديد” instead of “تصنيف_جديد”.
You’re incorrectly modifying the first parameter, $term_name, which has already had spaces removed. You also call this $term, which is confusing, and fail to reference all parameters.
The code you shared worked perfectly, and the terms are now being processed exactly as needed, with underscores replacing spaces. Your prompt assistance and clear guidance are greatly appreciated.