About
Context
Posts
usePosts
Default query (latest 10 posts):
const { data, loading, error } = usePosts();
Posts meeting the criteria:
const { data, loading, error } = usePosts({/* WordPress REST API options */});
Single post (by id):
const { data, loading, error } = usePosts(/* post id */);
Multiple posts (by id):
const { data, loading, error } = usePosts(/* array of post ids */);
useCreatePost
const { data, loading, error } = useCreatePost({/* WordPress REST API options */});
useRetrievePost
const { data, loading, error } = useRetrievePost({/* WordPress REST API options */});
useUpdatePost
const { data, loading, error } = useUpdatePost({/* WordPress REST API options */});
useDeletePost
const { data, loading, error } = useDeletePost(/* post id */,{ /* WordPress REST API options */ });