WP_REST_Server::get_namespaces() WordPress Method
The WP_REST_Server::get_namespaces() method is used to get the list of available REST API namespaces. This can be useful for introspecting what API endpoints are available.
WP_REST_Server::get_namespaces() #
Retrieves namespaces registered on the server.
Return
(string[]) List of registered namespaces.
Source
File: wp-includes/rest-api/class-wp-rest-server.php
public function get_namespaces() { return array_keys( $this->namespaces ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |