register_rest_route


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

Parameters:
  • (string) $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.
Returns:
  • (bool) True on success, false on error.
Defined at:

Description

Registers a REST API route.

Related Functions

register_rest_field, register_post_type, register_new_user, unregister_post_type, register_meta

Top Google Results

User discussions

wpseek mobile