CoreFiles by mySites.guru
class-wp-rest-post-meta-fields.php65 lines, 1,098 bytes, from wordpress-4.7.21.zip
Raw History Compare with 4.7.20
md5
0fb48cc8f80cee5263765dbc44915f58
sha1
db3672322aea7a4e8b6810594e3aa0d9e69a0f9b
sha256
debf6bd6649272a6c265f54452627701ed0c0e43970f42da9b24ff71322090f4
<?php
/**
 * REST API: WP_REST_Post_Meta_Fields class
 *
 * @package WordPress
 * @subpackage REST_API
 * @since 4.7.0
 */

/**
 * Core class used to manage meta values for posts via the REST API.
 *
 * @since 4.7.0
 *
 * @see WP_REST_Meta_Fields
 */
class WP_REST_Post_Meta_Fields extends WP_REST_Meta_Fields {

	/**
	 * Post type to register fields for.
	 *
	 * @since 4.7.0
	 * @access protected
	 * @var string
	 */
	protected $post_type;

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

	/**
	 * Retrieves the object meta type.
	 *
	 * @since 4.7.0
	 * @access protected
	 *
	 * @return string The meta type.
	 */
	protected function get_meta_type() {
		return 'post';
	}

	/**
	 * Retrieves the type for register_rest_field().
	 *
	 * @since 4.7.0
	 * @access public
	 *
	 * @see register_rest_field()
	 *
	 * @return string The REST field type.
	 */
	public function get_rest_field_type() {
		return $this->post_type;
	}
}

The same content is in 91 releases, WordPress 4.7-beta2 to 4.8.34. See them all, or every version of this file.