rest_get_url_prefix(): string

In this article

Retrieves the URL prefix for any API resource.

Return

string Prefix.

Source

function rest_get_url_prefix() {
	/**
	 * Filters the REST URL prefix.
	 *
	 * @since 4.4.0
	 *
	 * @param string $prefix URL prefix. Default 'wp-json'.
	 */
	return apply_filters( 'rest_url_prefix', 'wp-json' );
}

Hooks

apply_filters( ‘rest_url_prefix’, string $prefix )

Filters the REST URL prefix.

Changelog

VersionDescription
4.4.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.