woocommerce_ajax_get_endpoint

Get WC Ajax Endpoint.

Description

(string) apply_filters( 'woocommerce_ajax_get_endpoint', (unknown) $add_query_arg, (unknown) $request ); 

Returns (string)

Parameters (2)

0. $add_query_arg (unknown) => add_query_arg( 'wc-ajax', $request, remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart' ) ) )
The add query arg.
1. $request (unknown)
The request.

Usage

To run the hook, copy the example below.
  1. $add_query_arg = apply_filters( 'woocommerce_ajax_get_endpoint', $add_query_arg, $request ); 
  2.  
  3. if ( !empty( $add_query_arg ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_ajax_get_endpoint callback 
  2. function filter_woocommerce_ajax_get_endpoint( $add_query_arg, $request ) { 
  3. // make filter magic happen here... 
  4. return $add_query_arg
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_ajax_get_endpoint', 'filter_woocommerce_ajax_get_endpoint', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_ajax_get_endpoint', 'filter_woocommerce_ajax_get_endpoint', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/class-wc-ajax.php  
  1. return esc_url_raw( apply_filters( 'woocommerce_ajax_get_endpoint', add_query_arg( 'wc-ajax', $request, remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart' ) ) ), $request ) );