wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema
rest_api_register_rewrites › WordPress Function
Desde4.4.0
Obsoleton/a
› rest_api_register_rewrites ( Sem parâmetros )
Ver: | |
Definido em: |
|
Codex: |
Adds REST rewrite rules.
Funções relacionadas: wp_register_script, rest_api_init, _wp_register_meta_args_whitelist, register_rest_route, wp_deregister_script
Fonte
function rest_api_register_rewrites() { global $wp_rewrite; add_rewrite_rule( '^' . rest_get_url_prefix() . '/?$', 'index.php?rest_route=/', 'top' ); add_rewrite_rule( '^' . rest_get_url_prefix() . '/(.*)?', 'index.php?rest_route=/$matches[1]', 'top' ); add_rewrite_rule( '^' . $wp_rewrite->index . '/' . rest_get_url_prefix() . '/?$', 'index.php?rest_route=/', 'top' ); add_rewrite_rule( '^' . $wp_rewrite->index . '/' . rest_get_url_prefix() . '/(.*)?', 'index.php?rest_route=/$matches[1]', 'top' ); }