CoreFiles by mySites.guru
class-wp-rest-post-meta-fields.php37 lines, 635 bytes, from wordpress-4.7-beta1.zip
Raw History Compare with 4.6-beta4
md5
b63de784e8d394a250857db14f6dcd0d
sha1
84fea046937f15fcd4524410e87ba938612a5ef1
sha256
021f83ea50c785bca9d7d346fc384f261aa398204a5958653df3279c2016035b
<?php

class WP_REST_Post_Meta_Fields extends WP_REST_Meta_Fields {
	/**
	 * Post type to register fields for.
	 *
	 * @var string
	 */
	protected $post_type;

	/**
	 * Constructor.
	 *
	 * @param string $post_type Post type to register fields for.
	 */
	public function __construct( $post_type ) {
		$this->post_type = $post_type;
	}

	/**
	 * Get the object type for meta.
	 *
	 * @return string
	 */
	protected function get_meta_type() {
		return 'post';
	}

	/**
	 * Get the type for `register_rest_field`.
	 *
	 * @return string Custom post type slug.
	 */
	public function get_rest_field_type() {
		return $this->post_type;
	}
}

No other release has this exact content. See every version of this file.