CoreFiles by mySites.guru
class-wp-rest-term-meta-fields.php39 lines, 685 bytes, from wordpress-4.7-beta1.zip
Raw History Compare with 4.6-beta4
md5
8e20d27430a4ecb7a5e799a2856ce7f7
sha1
a5e2fd0ba97ba30a1a52acb2a22f1200f97319dc
sha256
3321d897e4915ab450e49f49df31fa6297f7cdb568301bc9f79f83ddd37cb7c5
<?php

/**
 * Manage meta values for terms.
 */
class WP_REST_Term_Meta_Fields extends WP_REST_Meta_Fields {
	/**
	 * Taxonomy to register fields for.
	 *
	 * @var string
	 */
	protected $taxonomy;
	/**
	 * Constructor.
	 *
	 * @param string $taxonomy Taxonomy to register fields for.
	 */
	public function __construct( $taxonomy ) {
		$this->taxonomy = $taxonomy;
	}

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

	/**
	 * Get the type for `register_rest_field`.
	 *
	 * @return string
	 */
	public function get_rest_field_type() {
		return 'post_tag' === $this->taxonomy ? 'tag' : $this->taxonomy;
	}
}

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