fetch.js
13 lines
| 1 | // import apiFetch from "@wordpress/api-fetch"; |
| 2 | const { apiFetch } = wp; |
| 3 | |
| 4 | // nonce and root |
| 5 | apiFetch.use(apiFetch.createNonceMiddleware(prestoPlayer.nonce)); |
| 6 | apiFetch.use( |
| 7 | apiFetch.createRootURLMiddleware( |
| 8 | prestoPlayer.root + prestoPlayer.prestoVersionString |
| 9 | ) |
| 10 | ); |
| 11 | |
| 12 | export default apiFetch; |
| 13 |