Filter
rp_ajax_get_endpoint
On this page
Filters the URL of the RestroPress frontend AJAX endpoint.
Runs in RP_AJAX::get_endpoint(). The default is the home URL with an rp-ajax query argument set to the request name. The final value is passed through esc_url_raw().
Parameters#
| Parameter | Type | Description |
|---|---|---|
$url | string | The default endpoint URL. |
$request | string | The AJAX request name. |
Return value#
string. The endpoint URL.
Example#
function my_ajax_endpoint( $url, $request ) {
return add_query_arg( 'my_lang', 'en', $url );
}
add_filter( 'rp_ajax_get_endpoint', 'my_ajax_endpoint', 10, 2 );
Source#
Applied in:
includes/class-rpress-ajax.php(line 31), inRP_AJAX::get_endpoint()
Was this page helpful?
