Skip to content

Instantly share code, notes, and snippets.

@phpbits
Created October 3, 2018 06:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save phpbits/28c01b89abb43cf403f3acb32fb78795 to your computer and use it in GitHub Desktop.
Save phpbits/28c01b89abb43cf403f3acb32fb78795 to your computer and use it in GitHub Desktop.
Using wp.apiRequest to access custom endpoints.
wp.apiRequest( { path: '/phpbits/test-blocks/v1/user-roles/' } )
.then(
( obj ) => {
console.log( obj );
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment