WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#40904 closed defect (bug) (invalid)

Cannot display meta value in REST API

Reported by: conner_bw Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7.5
Component: REST API Keywords:
Focuses: Cc:

Description

Steps to reproduce:

add_action( 'init', function() {
        register_meta( 'post', 'zigzag', [ 'show_in_rest' => true ] );
} );

In WordPress multi-site, edit an existing post and add a a custom value for key name 'zigzag', save the post.

Go to: http://DOMAIN/SITE/wp-json/wp/v2/posts/ID

Expected: meta node has a value for zigzag
Actual: zigzag is empty.

Reference: scroll down to "Working with Meta"
https://developer.wordpress.org/rest-api/extending-the-rest-api/modifying-responses/

Attachments (2)

meta1.PNG (50.3 KB) - added by conner_bw 3 years ago.
meta2.PNG (35.6 KB) - added by conner_bw 3 years ago.

Download all attachments as: .zip

Change History (4)

@conner_bw
3 years ago

@conner_bw
3 years ago

#1 @conner_bw
3 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Wow, i'm an idiot. Spelling mistake.

zizag != zigzag

Close bug.

#2 @swissspidy
3 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.