Complete the code to get the default REST API base URL in WordPress.
const apiBase = wpApiSettings.[1];The default REST API base URL is stored in wpApiSettings.root.
Complete the code to fetch posts from the default WordPress REST API endpoint.
fetch(wpApiSettings.root + 'wp/v2/[1]')
The default endpoint to get posts is wp/v2/posts.
Fix the error in the code to get a single post by ID from the WordPress REST API.
fetch(wpApiSettings.root + 'wp/v2/posts/[1]')
You must replace the placeholder with an actual post ID number, like 123.
Fill both blanks to create a URL to fetch comments for a specific post ID.
const url = wpApiSettings.root + 'wp/v2/[1]/[2]/comments';
To get comments for a post, use 'posts' and the post ID like '123'.
Fill all three blanks to build a URL to update a post with ID 789 using the REST API.
fetch(wpApiSettings.root + 'wp/v2/[1]/[2]', { method: '[3]' })
To update a post, use 'posts' as the type, the post ID '789', and the HTTP method 'PUT'.
