Commit 40584db
📦 NEW: External @wordpress/api-fetch
Allows using the external wp.apiFetch method. Otherwise, if you try to import it from the @wordpress/api-fetch package, it won't have the REST API base URL initialized.
Example of usage:
import apiFetch from '@wordpress/api-fetch';
apiFetch( { path: '/wp/v2/posts' } ).then( posts => {
console.log( posts );
} );1 parent 715dd8d commit 40584db
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
0 commit comments