grappler / polylang-slug

A unique post slug within the language in Polylang. This allows for a page to have same/identical slug in multiple languages.
275 stars 84 forks source link

Problem with XML Sitemap & Google News feeds #37

Closed beherit closed 6 years ago

beherit commented 7 years ago

Please take a look this issue:

https://wordpress.org/support/topic/this-is-not-a-valid-feed/

When I have enabled polylang-slug I have problem with "XML Sitemap & Google News feeds" and sitemap - I see there only pages from one language. When I furn off plugin OR comment 2 filers: polylang_slug_posts_where_filter and polylang_slug_posts_join_filter everything's start working. Could You add fix for it?

P.S. Return TRUE in filter polylang_slug_disable doesen't work at all - still must change page language to see taxonomy (categories and tags) in sitemap.

RavanH commented 7 years ago

Would changing line 264 if ( is_admin() || ! function_exists( 'pll_current_language' ) || $disable ) { to if ( is_admin() || is_feed() || ! function_exists( 'pll_current_language' ) || $disable ) { solve the issue?

beherit commented 7 years ago

Yes, thank You :)

RavanH commented 7 years ago

But it might break slugs in feeds... please verify.

beherit commented 7 years ago

Slugs in feeds are still okey for me ;)

grappler commented 6 years ago

I have added a fix for this.

Otherwise the filter should have worked like this.

add_filter( 'polylang_slug_disable', function( $disable ) {
    if ( is_feed() ) {
        return true;
    }
    return $disable;
} );