rest_api_init()
Registers rewrite rules for the REST API.
No Hooks.
Return
null
. Nothing (null).
Usage
rest_api_init();
Notes
- See: rest_api_register_rewrites()
- Global. WP. $wp Current WordPress environment instance.
Changelog
Since 4.4.0 | Introduced. |
rest_api_init() rest api init code WP 6.6.2
function rest_api_init() { rest_api_register_rewrites(); global $wp; $wp->add_query_var( 'rest_route' ); }