get_namespaces() 공개 메소드

Retrieves namespaces registered on the server.
부터: 4.4.0
public get_namespaces ( ) : array
리턴 array List of registered namespaces.
 public function test_get_namespaces()
 {
     $server = new WP_REST_Server();
     $server->register_route('test/example', '/test/example/some-route', array(array('methods' => WP_REST_Server::READABLE, 'callback' => '__return_true')));
     $server->register_route('test/another', '/test/another/route', array(array('methods' => WP_REST_Server::READABLE, 'callback' => '__return_false')));
     $namespaces = $server->get_namespaces();
     $this->assertContains('test/example', $namespaces);
     $this->assertContains('test/another', $namespaces);
 }