WordPress filter hook
woocommerce_ajax_get_endpoint
Defined by WooCommerce and fired by 7 plugins in total, running on 7.2M+ sites between them.
How to use woocommerce_ajax_get_endpoint
It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_ajax_get_endpoint', function( $query_arg, $request ) {
// Change $query_arg here.
return $query_arg;
}, 10, 2 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
7 plugins that fire woocommerce_ajax_get_endpoint
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_ajax_get_endpoint', add_query_arg( 'wc-ajax', $request, remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart', 'order_again', '_wpnonce' ), home_url( '/', 'relative' ) ) ), $request )includes/class-wc-ajax.php:56 -
Payment Plugins for Stripe WooCommerce100,000+ installs
apply_filters( 'woocommerce_ajax_get_endpoint', add_query_arg( 'wc-ajax', 'wc_stripe_frontend_request', remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart', 'order_again', '_wpnonce' ), home_url( '/', 'relative' ) ) ), 'wc_stripe_frontend_request' )includes/class-wc-stripe-rest-api.php:166 -
Payment Plugins for PayPal WooCommerce80,000+ installs
apply_filters( 'woocommerce_ajax_get_endpoint', add_query_arg( 'wc-ajax', 'wc_stripe_frontend_request', remove_query_arg( [ 'remove_item', 'add-to-cart', 'added-to-cart', 'order_again', '_wpnonce' ], home_url( '/', 'relative' ) ) ), 'wc_ppcp_frontend_request' )src/Rest/RestController.php:143 -
Freight Integration for Woocommerce to Profrakt and Logistra by WildRobot200+ installs
apply_filters( 'woocommerce_ajax_get_endpoint', add_query_arg( "wc-ajax", $request, remove_query_arg( [ "remove_item", "add-to-cart", "added-to-cart", "order_again", "_wpnonce", ], home_url("/", "relative"), ), ), $request )includes/class-wildrobot-logistra-ajax.php:33 -
Confirm Shipping Address Before Order20+ installs
apply_filters( 'woocommerce_ajax_get_endpoint', add_query_arg('wc-ajax', $request, home_url('/', 'relative')), $request )wc-confirm-shipping-address-before-placing-order.php:74 -
Payments via Stripe for WooCommerce10+ installs
apply_filters( 'woocommerce_ajax_get_endpoint', add_query_arg( 'wc-ajax', 'wpp_api_frontend_request', remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart', 'order_again', '_wpnonce' ), home_url( '/', 'relative' ) ) ), 'wpp_api_frontend_request' )includes/class-wpp-rest-api.php:165 -
Invoice management for WoocommerceFewer than 10 installs
apply_filters( 'woocommerce_ajax_get_endpoint', add_query_arg( 'wc-ajax', $request, remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart', 'order_again', '_wpnonce' ), home_url( '/', 'relative' ) ) ), $request )includes/class-wc-ajax.php:36
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.