Bird
0
0

You want to add metadata to multiple posts to track 'likes' count. Which approach best extends content efficiently?

hard📝 Application Q8 of 15
Wordpress - Custom Fields and Meta Data
You want to add metadata to multiple posts to track 'likes' count. Which approach best extends content efficiently?
AUse update_post_meta for each post with the 'likes' key and count value
BEdit the main post content to include likes count manually
CCreate a new post type for likes instead of metadata
DStore likes count in a cookie on the user's browser
Step-by-Step Solution
Solution:
  1. Step 1: Identify best method to store per-post extra data

    Metadata is designed to store extra info like likes count per post efficiently.
  2. Step 2: Evaluate options

    Updating metadata with update_post_meta is correct; editing content or using cookies is not suitable.
  3. Final Answer:

    Use update_post_meta for each post with the 'likes' key and count value -> Option A
  4. Quick Check:

    Use update_post_meta for extra post info [OK]
Quick Trick: Use update_post_meta to add or change metadata [OK]
Common Mistakes:
  • Editing main content for metadata
  • Using cookies for server data
  • Creating unnecessary post types

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes