• Resolved sbdev1stepan

    (@sbdev1stepan)


    Hello! First of all I would like to say that your plugin is awesome! I always use it, suggest to my clients and install by default on my projects 🙂

    But recently I faced with the issue. In the description of the plugin it is said it supports WPGlobus plugin. But I can’t set different SEO text for different languages. And the text like this “{:en}English title{:}{:uk}Ukrainian title{:}” doesn’t help.
    I found the way to translate it by applying a filter “the_title” to all output lines. So the above schema “{:en}{:}{:uk}{:}” works. But it is not efficient.

    I wasn’t able to find any further information about the support of WPGlobus plugin neither here nor on WPGlobus site.

    I would really appreciate if you could provide me with some information!

    Regards,
    Stepan

Viewing 1 replies (of 1 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi Stepan,

    TSF doesn’t support that feature of WPGlobus out of the box. It works with WPGlobus without custom SEO meta, however. The userbase of WPGlobus and TSF doesn’t really overlap, so there’s little demand for us to look into some intricacies.

    Nevertheless, please add this snippet to your site to add support for it:

    add_action( 'the_seo_framework_front_init', function() {
    	add_filter( 'the_seo_framework_post_meta', 'my_tsf_wpglobus_filter' );
    	add_filter( 'the_seo_framework_term_meta', 'my_tsf_wpglobus_filter' );
    
    	function my_tsf_wpglobus_filter( $data ) {
    		static $filter;
    		$filter = $filter ?? method_exists( 'WPGlobus_Filters', 'filter__text' );
    		return $filter ? array_map( [ 'WPGlobus_Filters', 'filter__text' ], $data ) : $data;
    	}
    } );

    It’s quick with adding support for all fields, and it will only execute those on the front-end. That brings a caveat: The SEO Bar doesn’t recognize the transformation and will, therefore, report some data inaccurately.

    • This reply was modified 4 years, 4 months ago by Sybre Waaijer. Reason: Removed debugging code
Viewing 1 replies (of 1 total)

The topic ‘WPGlobus not working’ is closed to new replies.