rankmath / seo-by-rank-math

Rank Math is a revolutionary WordPress SEO Plugin that combines the features of many SEO tools and lets you multiply your traffic in the easiest way possible :bulb: :chart_with_upwards_trend: →
https://rankmath.com
107 stars 52 forks source link

Introduce the filter hook `rank_math/frontend/breadcrumb/is_using_shop_base` #70

Closed strategio closed 3 years ago

strategio commented 3 years ago

We (WPML) need this filter to fix this issue in a smarter way.

And this is how we are planning to use this new filter hook (POF):

add_filter( 'rank_math/frontend/breadcrumb/is_using_shop_base', function( $isUsingShopBase ) {
        if ( $isUsingShopBase ) {
            return $isUsingShopBase;
        }

        $defaultShop = wpml_collect( Translations::get( wc_get_page_id( 'shop' ), 'post_page' ) )
            ->first( Obj::prop( 'original' ) );
        $productBase = Obj::prop( 'product_base', wc_get_permalink_structure() );

        return $productBase === '/' . get_post( Obj::prop( 'element_id', $defaultShop ) )->post_name;
    }

https://onthegosystems.myjetbrains.com/youtrack/issue/wpmlwpseo-156

surajv commented 3 years ago

Hi @strategio

Thank you for the PR. We have merged it and released the update v1.0.62.

strategio commented 3 years ago

Thank you @surajv :)