X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/febc815b2c9d85be5717da9e8d164bd2daa97e31..16e7b37c7914d753890c1a05a9335f3b43751eb8:/wp-includes/rest-api/fields/class-wp-rest-term-meta-fields.php diff --git a/wp-includes/rest-api/fields/class-wp-rest-term-meta-fields.php b/wp-includes/rest-api/fields/class-wp-rest-term-meta-fields.php new file mode 100644 index 00000000..da1349b6 --- /dev/null +++ b/wp-includes/rest-api/fields/class-wp-rest-term-meta-fields.php @@ -0,0 +1,63 @@ +taxonomy = $taxonomy; + } + + /** + * Retrieves the object meta type. + * + * @since 4.7.0 + * @access protected + * + * @return string The meta type. + */ + protected function get_meta_type() { + return 'term'; + } + + /** + * Retrieves the type for register_rest_field(). + * + * @since 4.7.0 + * @access public + * + * @return string The REST field type. + */ + public function get_rest_field_type() { + return 'post_tag' === $this->taxonomy ? 'tag' : $this->taxonomy; + } +}