Complete the code to add metadata to a WordPress post.
add_post_meta([1], 'color', 'blue');
The add_post_meta function requires the post ID as the first argument to attach metadata to the correct post.
Complete the code to retrieve metadata from a WordPress post.
$color = get_post_meta([1], 'color', true);
The get_post_meta function needs the post ID to fetch the correct metadata value.
Fix the error in the code to update metadata correctly.
update_post_meta([1], 'color', 'red');
The update_post_meta function requires the post ID to update the metadata for the correct post.
Fill both blanks to create metadata and then retrieve it.
add_post_meta([1], 'author', 'Alice'); $author = get_post_meta([2], 'author', true);
Both functions need the post ID to correctly add and retrieve metadata linked to the post.
Fill all three blanks to update metadata, then get it, and finally delete it.
update_post_meta([1], 'status', 'published'); $status = get_post_meta([2], 'status', true); delete_post_meta([3], 'status');
All metadata functions require the post ID to operate on the correct post's metadata.