Skip to content
Docs
Get RestroPress

Filter

rpress_ajax_url

Updated
On this page

Filters the URL used for RestroPress AJAX requests.

The URL is admin-ajax.php with its scheme adjusted to match the current page's HTTP or HTTPS scheme. Filter it to point AJAX calls at a different endpoint, for example on a cached or proxied setup.

Parameters#

ParameterTypeDescription
$ajax_urlstringThe admin-ajax.php URL.

Return value#

string. The AJAX URL.

Example#

function my_rpress_ajax_url( $ajax_url ) {
	return add_query_arg( 'lang', 'en', $ajax_url );
}
add_filter( 'rpress_ajax_url', 'my_rpress_ajax_url' );

Source#

Applied in:

  • includes/rp-ajax-functions.php (line 111), in rpress_get_ajax_url()

See also#

Was this page helpful?