• Hi,

    When the value of a custom global dynamic variable set via seopress_titles_template_replace_array hook contains umlauts (e.g. “März” which is march in German), the variable get’s filtered and nothing gets displayed on the frontend.

    I assume this issue also happens with special characters of other languages.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Benjamin Denis

    (@rainbowgeek)

    Hi,
    can you paste your full code please?

    Thank you!

    Thread Starter nicoter

    (@nicoter)

    Sure. I adjusted the locale and timestamp so it outputs “march” in German as of now. Obviously you have to use %%march%% in the meta title.

    
    function sp_titles_template_replace_array($array) {
    	setlocale (LC_TIME, 'de_DE');
    	$m = time() + (6 * 24 * 60 * 60); // add 6 days to set timestamp to march
    	$march = strftime("%B", $m);
    	$array[] = esc_attr(wp_strip_all_tags($march));
    	return $array;
    }
    add_filter('seopress_titles_template_replace_array', 'sp_titles_template_replace_array');
    

    Thanks

    Plugin Author Benjamin Denis

    (@rainbowgeek)

    I’m not sure to understand what information you want to output in your meta title.

    The current month? You can use this variable for this:

    %%currentmonth%%

    This variable uses date_i18n function (https://developer.ww.wp.xz.cn/reference/functions/date_i18n/)

    Thread Starter nicoter

    (@nicoter)

    I’m aware of %%currentmonth%%. I don’t want to reveal my code in public, thus I was giving you a working example.

    The issue remains, if the variable contains an umlaut such as ä,ö or ü it will somehow get filtered and not displayed on the frontend.

    Are you suggesting I should use date_i18n() instad of strftime()?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘seopress_titles_template_replace_array: Problem w/ umlauts in’ is closed to new replies.