Created
April 16, 2020 06:52
-
-
Save digitalchild/4fcb71d144d7efdba14af2f9d85269a9 to your computer and use it in GitHub Desktop.
Use the WC Vendors Marketplace vendor store name as the brand with Rank Math SEO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Use vendor store name for brand if using RankMath SEO. | |
add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) { | |
global $post; | |
$shop_name = get_user_meta( $post->post_author, 'pv_shop_name', true ); | |
$entity['brand'] = $shop_name; | |
return $entity; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment