register_rest_route ( $route_namespace, $route, $args = array(), $override = false )

  • (string) route_namespace The first URL segment after core prefix. Should be unique to your package/plugin.
  • (string) route The base URL for route you are adding.
  • (array) args Optional. Either an array of options for the endpoint, or an array of arrays for multiple methods. Default empty array.
  • (bool) override Optional. If the route already exists, should we override it? True overrides, false merges (with newer overriding if duplicate keys exist). Default false.
  • (bool) True on success, false on error.
Defined at:
Change Log:
  • 5: .
  • 5: .


Registers a REST API route.Note: Do not use before the {@see 'rest_api_init'} hook.

Related Functions

register_rest_field, register_post_type, unregister_post_type, register_new_user, register_post_meta

Top Google Results

User discussions

wpseek mobile