home *** CD-ROM | disk | FTP | other *** search
/ HTML Examples / WP.iso / wordpress / wp-includes / rest-api / fields / class-wp-rest-comment-meta-fields.php next >
Encoding:
PHP Script  |  2017-07-26  |  702 b   |  41 lines

  1. <?php
  2. /**
  3.  * REST API: WP_REST_Comment_Meta_Fields class
  4.  *
  5.  * @package WordPress
  6.  * @subpackage REST_API
  7.  * @since 4.7.0
  8.  */
  9.  
  10. /**
  11.  * Core class to manage comment meta via the REST API.
  12.  *
  13.  * @since 4.7.0
  14.  *
  15.  * @see WP_REST_Meta_Fields
  16.  */
  17. class WP_REST_Comment_Meta_Fields extends WP_REST_Meta_Fields {
  18.  
  19.     /**
  20.      * Retrieves the object type for comment meta.
  21.      *
  22.      * @since 4.7.0
  23.      *
  24.      * @return string The meta type.
  25.      */
  26.     protected function get_meta_type() {
  27.         return 'comment';
  28.     }
  29.  
  30.     /**
  31.      * Retrieves the type for register_rest_field() in the context of comments.
  32.      *
  33.      * @since 4.7.0
  34.      *
  35.      * @return string The REST field type.
  36.      */
  37.     public function get_rest_field_type() {
  38.         return 'comment';
  39.     }
  40. }
  41.