class StatsController extends GenericStatsController { * /** Route of your new REST endpoint. */ * protected $rest_base = 'reports/my-thing/stats'; * /** Define your proeprties schema. */ * protected function get_item_properties_schema() { * return array( * 'my_property' => array( * 'title' => __( 'My property', 'my-extension' ), * 'type' => 'integer', * 'readonly' => true, * 'context' => array( 'view', 'edit' ), * 'description' => __( 'Amazing thing.', 'my-extension' ), * 'indicator' => true, * ), * ); * } * /** Define overall schema. You can use the defaults, * * just remember to provide your title and call `add_additional_fields_schema` * * to run the filters * */ * public function get_item_schema() { * $schema = parent::get_item_schema(); * $schema['title'] = 'report_my_thing_stats'; * * return $this->add_additional_fields_schema( $schema ); * } * } *