Skip to content

Instantly share code, notes, and snippets.

@digitalchild
Created April 16, 2020 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitalchild/4fcb71d144d7efdba14af2f9d85269a9 to your computer and use it in GitHub Desktop.
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
<?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