Accessing post meta in blocks requires using getEditedPostAttribute('meta')
rather than traditional PHP get_post_meta()
functions. This selector accesses the current post’s meta data through the block editor’s Redux store.
Post meta must be registered through PHP’s register_post_meta() function to appear in the REST API and block editor. Without registration, meta fields remain invisible to JavaScript even if they exist in the database.
The block editor operates through the REST API rather than direct database access, requiring explicit meta field registration with proper schemas and security configurations before JavaScript can access the data.