Ian Dunn

Ian Dunn

WordPress Developer

Menu

Skip to content
  • Home
  • About
  • Archives
  • Contact

Tag Archives: Post Meta

Exposing Custom Post Type Meta for Only a Single API Endpoint

I ran into an undocumented and unexpected problem when registering custom post type meta fields for the REST API. register_meta() exposes meta fields in all REST API endpoints, which can lead to privacy leaks. To avoid that, it can be called conditionally.

Continue reading...

Posted on March 30, 2017 by Ian Dunn. Posted in WordPress | Tagged Custom Post Types, Post Meta, Privacy, register_meta(), register_rest_field(), REST API | 2 Comments

Accessing Post Meta and More Via $post->meta_key

It turns out there's a much better way to fetch post meta than get_post_meta( $post->ID, 'foo', true ): $post->foo.

Continue reading...

Posted on October 22, 2016 by Ian Dunn. Posted in WordPress | Tagged Post Meta | 3 Comments

Subscribe via Email

Feeds & Profiles

  • RSS
  • WordPress.org
  • GitHub
  • HackerOne
  • LinkedIn