Skip to content

Common changes with a few lines of code (Recipes)

Reign WC Vendors Addon overviewPremiumGet Reign WC Vendors Addon →

Also called: code snippets, functions.php recipes, child theme examples, marketplace code, WC Vendors add-on hooks examples

Each recipe below makes one change that site owners often ask for. Copy the snippet, paste it into your child theme, and save. Every snippet was tested with Reign WC Vendors Addon 2.8.0, WC Vendors, Reign 8.1.0 and the official Reign child theme.

  • Install and activate the Reign child theme. Changes in the parent theme are lost when Reign updates.
  • Open the child theme’s functions.php. Paste each snippet at the very end of the file.
  • Edit files through your host’s file manager or SFTP. If a snippet has a typo, the site can show an error. You can then fix the file the same way.

Try each change on a staging copy first if your site is busy.

The add-on has no template files to copy. Every change below is a filter.

Members find their saved products in My Account > Favourites, at /my-account/favourites/. This snippet moves the page to /my-account/saved-products/.

add_filter( 'reign_mv_favourites_endpoint', function () {
return 'saved-products';
} );

After you save the snippet, go to Settings > Permalinks and click Save Changes. WordPress then learns the new address. If another plugin already uses the address, the add-on skips the page and shows a notice.

You’ll know it worked when the Favourites link in My Account opens /my-account/saved-products/, and the old address shows “Page not found”.

Members can save up to 200 products with the heart button. This snippet raises the limit to 500.

add_filter( 'reign_mv_favourites_cap', function () {
return 500;
} );

The Reign Dokan add-on reads the same filter. A value below 1 is treated as 1.

You’ll know it worked when this WP-CLI command prints 500: wp eval 'echo Reign_WCV_Favourites::cap();'. Members can then keep saving past 200 products.

Vendor profiles get a Store tab. This snippet makes it off by default, for example when you set up many sites from one child theme.

add_filter( 'reign_wcv_default_settings', function ( $defaults ) {
$defaults['store_tab'] = 'off';
return $defaults;
} );

Settings here use on and off. A value an owner saved on the settings screen still wins. On a site where someone already saved the settings, switch Store tab on vendor profiles off there instead.

You’ll know it worked when a vendor’s profile shows no Store tab.

Open functions.php again through your host’s file manager or SFTP. Remove the snippet you just added and save. The site comes back straight away.

Yes. These snippets work the same in a snippets plugin.

Every filter the add-on offers is in Filters and stored data.