Skip to content
Docs
Get RestroPress

Filter

rp_ajax_get_endpoint

Updated
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#

ParameterTypeDescription
$urlstringThe default endpoint URL.
$requeststringThe 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), in RP_AJAX::get_endpoint()
Was this page helpful?