MS Web Arts Rebranding Logo Icon
MS Web Arts Rebranding Logo
View Categories

Hooks: Filters

2 min read

Visibility & permissions

FilterArgumentsPurpose
wcoffers_show_request_button$show, $productHide/show the request button per product.
wcoffers_offer_creator_roles$rolesRole slugs allowed to create offers (default administrator, shop_manager). Capability holders and active marketplace sellers pass regardless of this list.
wcoffers_user_can_create_offers$can, $user_idFinal say on offer-creation permission. Can deny anyone, including admins.
wcoffers_chat_message_moderator$moderator, $userWho may delete offer/system chat messages (default: administrators).
wcoffers_load_chat_ui$loadWhether the chat Create Offer UI loads at all.

Validation & limits

FilterArgumentsPurpose
wcoffers_validate_request$errors, $dataAdd custom validation to request submissions (WP_Error accumulator).
wcoffers_validate_offer$errors, $offerAdd custom send-time validation to offers.
wcoffers_request_rate_limit$limit, $customer_idMax requests per customer per rolling 10 minutes (default 10; return 0 to disable).
wcoffers_offer_send_rate_limit$limit, $seller_idMax offer sends per seller per rolling 10 minutes (default 20; return 0 to disable).

Checkout & money

FilterArgumentsPurpose
wcoffers_accept_redirect$url, $offerWhere the customer lands after clicking Accept.
wcoffers_checkout_fees$fees, $baseAdjust the fee rows applied at offer checkout.
wcoffers_package_rates$offer_rates, $rates, $packageAdjust the shipping rate that replaces store rates for an offer.
wcoffers_order_status_map$map, $order_statusChange how order statuses map to offer statuses.
wcoffers_offer_can_transition$legal, $from, $toOverride offer status-machine legality (use with care).
wcoffers_request_can_transition$legal, $from, $toSame, for requests.

Misc & advanced

FilterArgumentsPurpose
wcoffers_send_email$send, $user_id, $subject, $bodySuppress any plugin email (return false).
wcoffers_setting$value, $keyOverride any single plugin setting on the fly.
wcoffers_product_search_args$args, $term, $seller_idAdjust the wc_get_products query behind the popup product pickers.
wcoffers_messaging_providers$providersRegister/replace messaging providers. See Extending the Plugin.
wcoffers_seller_resolvers$resolversRegister/replace marketplace seller resolvers.
wcoffers_template_paths$pathsChange the template override lookup locations.

Example: let vendors’ staff send offers, but block one specific user

add_filter( 'wcoffers_offer_creator_roles', function ( $roles ) {
	$roles[] = 'vendor_staff';
	return $roles;
} );

add_filter( 'wcoffers_user_can_create_offers', function ( $can, $user_id ) {
	return 999 === $user_id ? false : $can;
}, 10, 2 );

Example: hide the request button on a whole category

add_filter( 'wcoffers_show_request_button', function ( $show, $product ) {
	if ( has_term( 'gift-cards', 'product_cat', $product->get_id() ) ) {
		return false;
	}
	return $show;
}, 10, 2 );
Go to Top