wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
rest_api_register_rewrites › WordPress Function
Seit4.4.0
Veraltetn/v
› rest_api_register_rewrites ( Keine Parameter )
Siehe: | |
Definiert in: |
|
Codex: |
Adds REST rewrite rules.
Ähnliche Funktionen: wp_register_script, rest_api_init, _wp_register_meta_args_whitelist, register_rest_route, wp_deregister_script
Quellcode
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' ); }