rest_api_init

The timeline below displays how wordpress function rest_api_init has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.6

/**
 * Registers rewrite rules for the REST API.
 *
 * @since 4.4.0
 *
 * @see rest_api_register_rewrites()
 * @global WP $wp Current WordPress environment instance.
 */
function rest_api_init()
{
    rest_api_register_rewrites();
    global $wp;
    $wp->add_query_var('rest_route');
}

WordPress Version: 4.4

/**
 * Registers rewrite rules for the API.
 *
 * @since 4.4.0
 *
 * @see rest_api_register_rewrites()
 * @global WP $wp Current WordPress environment instance.
 */
function rest_api_init()
{
    rest_api_register_rewrites();
    global $wp;
    $wp->add_query_var('rest_route');
}