- availability:
-
WooCommerce Multilingual Version: 3.8
- description:
-
Filter endpoint values before getting permalinks.
- type:
- filter
- category:
- Miscellaneous
- parameters:
-
add_filter( 'wcml_endpoint_permalink_filter', 'the_callback_function', 10, 2 );
There are two parameters passed to this filter:
- $endpoint
- (string) The endpoint value.
- $key
- (string) The endpoint key.
- hook example usage:
-
Example
/* * Add this code to the functions.php file of your theme. * This is extracted from the WCML WC Subscriptions compatibility class. */ add_filter( 'wcml_endpoint_permalink_filter', 'endpoint_permalink_filter', 10, 2) ; function endpoint_permalink_filter( $endpoint, $key ){ if( $key == 'view-subscription' ){ return 'view-subscription'; } return $endpoint; }