Default dynamic variables that write to filter hook doesn’t work in meta title.

[ad_1]

Hi,

the dynamic variables replacement has already been done when using this filter.

Here is the code to use:

function sp_titles_title($html) {
    
    $variables = null;
    $variables = apply_filters('seopress_dyn_variables_fn', $variables);
    $seopress_titles_template_variables_array = $variables['seopress_titles_template_variables_array'];
    $seopress_titles_template_replace_array   = $variables['seopress_titles_template_replace_array'];

    $html="test filter hooks at %%post_title%%";

    $html = str_replace($seopress_titles_template_variables_array, $seopress_titles_template_replace_array, $html);

    return $html;
  }
  add_filter('seopress_titles_title', 'sp_titles_title');

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer