Skip to content

Hooks and Filters

Every hook below exists in the 2.0.0 codebase. Names not listed here are not part of the plugin’s public surface.

Filter the vendor menu list (products, favorite-products, and, whenever any supported marketplace is active, become-a-vendor) before the tabs and settings fields are built.

add_filter( 'wbpm_get_multivendor_menus', function ( $menus ) {
// $menus is [ slug => label ]
return $menus;
} );

wbpm_multivendor_menu_setting_for_peepso_profile

Section titled “wbpm_multivendor_menu_setting_for_peepso_profile”

Filter the same menu list specifically when the admin settings fields (enable/label per tab) are generated.

Filter whether a given tab is shown on a profile. Receives the tab’s enable value, the menu slug, and the menu/links context. Used by My Products, Favorite Products, Become a Vendor and the sub-tab builder.

add_filter( 'wbpm_show_tab_on_peepso_profile', function ( $enable, $menu_slug, $context ) {
return $enable;
}, 10, 3 );

Two more menu filters, wbpm_filter_vendor_dashboard_subtabs and wbpm_vendor_dashboard_default_subtab, still fire but are legacy holdovers; see Legacy filters.

Each slug helper is filterable so a site can rename a URL segment:

  • wbpm_get_products_subtab_slug, default products
  • wbpm_get_fav_products_subtab_slug, default favorite-products
  • wbpm_get_become_vendor_subtab_slug, default become-a-vendor

Two more slug filters still exist but are legacy holdovers from before the 2.0.0 showcase and no longer map to a rendered tab: wbpm_get_main_tab_slug (default vendor-dashboard) and wbpm_get_order_received_subtab_slug (default order-received). The showcase removed the vendor-dashboard/order-received surfaces, so filtering these has no visible effect; they remain only for backward compatibility.

Filter whether the current viewer may see a profile’s Favorite Products. Default: owner-only. Receives ( $can, $view_user_id, $current_user_id ).

Filter whether the favorite heart renders on shop/archive product cards. Receives the boolean from the wbpm_fav_icon_enable_shop option.

Logged-in-only AJAX endpoint (wp_ajax_wbpm_mark_product_fav) that toggles a favorite. Nonce action wbpm_mark_product_fav. Expects POST product_id and product-action (mark-fav or remove-fav). Writes user meta wbpm_my_fav_products and post meta wbpm_fav_product_by_user. There is no nopriv handler.

The nonce and labels are exposed to the frontend script via the wbpm_frontend localize object (ajaxurl, nonce, labels).

All marketplace-neutral; work on any WooCommerce store.

  • wbpm_customer_tab_enabled, filter the master Purchases-tab enable (from wbpm_customer_enable).
  • wbpm_customer_subtab_enabled, filter a single sub-tab’s enable; receives ( $enabled, $sub ) where $sub is orders|downloads|addresses.
  • wbpm_customer_tab_slug, filter the Purchases URL segment (default purchases).
  • wbpm_customer_tab_label, filter the tab label (default Purchases).
  • wbpm_customer_subtabs, filter the ordered sub-tab array (key => label).
  • wbpm_customer_can_view, privacy gate; default owner-only. Receives ( $can, $view_user_id, $current_user_id ).
  • wbpm_customer_orders_per_page, orders per page (default 10).
  • wbpm_customer_orders_query_args, filter the wc_get_orders() args; receives ( $args, $user_id, $paged ).

The plugin adds a Multivendor Settings group to each member’s PeepSo profile preferences (via PeepSo’s peepso_profile_preferences filter). Two filters gate whether individual fields are offered; both default to 1 (shown):

  • wbpm_fav_pro_tab_user_setting_display, whether the “Display my favorite products to other users” toggle is offered (stored in user meta peepso_wbpm_enable_fav_pro_tab_display).
  • wbpm_show_on_shop_setting_display, whether the vendor-only “Display my products on shop page” toggle is offered (stored in user meta peepso_wbpm_enable_show_on_shop_display).

The third field, “Add activity on Product Creation” (user meta peepso_wbpm_enable_product_creation_activity, vendors only), is gated by the admin option wbpm_product_creation_activity_setting_display rather than a filter.

Fired when a vendor’s newly-published product is posted to the PeepSo stream (see Settings):

  • wbpm_alter_activity_allowed_by_user, filter the per-vendor opt-in before an activity is created. Receives ( $allowed, 'wbpm_enable_product_creation_activity', $author_id ).
  • wbpm_product_create_content_activity_params, filter the token legend ({user_name}, {product_name}, {product_excerpt}) shown under the activity-message setting.
  • wbpm_filter_activity_content, filter the final rendered activity content after token replacement. Receives ( $content, $activity_info ).
  • wbpm_peepso_modify_activity_content, filter content for an activity of an unrecognised type (the default branch of the renderer). Receives ( $content ).
  • wbpm_featured_product_ids, filter the featured-product ID list the plugin uses to float featured products to the top of the WooCommerce shop. Wraps wc_get_featured_product_ids().
  • wbpm_peepso_multivendor_template_path, the plugin’s template directory name (default peepso-multivendor/).
  • wbpm_peepso_multivendor_set_template_path, the default template lookup path. Receives ( $path, $template, $args ).
  • wbpm_peepso_multivendor_get_template_part, the resolved template file before it is included. Receives ( $template, $slug, $name ).
  • wbpm_peepso_multivendor_plugin_locale, the plugin locale for text-domain loading.
  • wbpm_peepso_multivendor_loaded, fired once the main plugin class has constructed. Use it to hook code that depends on the plugin being present.

These filters still fire but map to surfaces the 2.0.0 showcase removed (the old vendor-dashboard/pagination machinery). They remain for backward compatibility and have no visible effect on the showcase:

  • wbpm_filter_vendor_dashboard_subtabs, filter the assembled sub-tab array (link + label per enabled tab).
  • wbpm_vendor_dashboard_default_subtab, filter the default sub-tab key.
  • wbpm_get_pagenum_link, filter the custom pagination URL used by the old bespoke pager (the product grid now uses the [products] shortcode’s own pager).

Filter the list of adapter class names the marketplace manager loads. Add a class here to register a new marketplace adapter. See Adapters.

add_filter( 'peepso_mv_adapters', function ( $classes ) {
$classes[] = 'My_Marketplace_MV_Adapter';
return $classes;
} );

Marketplace-agnostic helpers, safe to call anywhere:

  • peepso_mv_is_vendor( $user_id ), is the user a vendor on the active marketplace?
  • peepso_mv_store_url( $user_id ), the vendor’s public store URL, or ''.
  • peepso_mv_active_is( $id ), is the active adapter the given id (e.g. 'dokan')?