Exemplo n.º 1
2
 /**
  * @override
  */
 public function register_fields()
 {
     parent::register_fields();
     // Custom fields
     register_rest_field($this->_postTypeName, 'xp', array('get_callback' => array($this, 'get_xp')));
     register_rest_field($this->_postTypeName, 'perk_points', array('get_callback' => array($this, 'get_perk_points')));
     register_rest_field($this->_postTypeName, 'energy', array('get_callback' => array($this, 'get_energy_points')));
     register_rest_field($this->_postTypeName, 'starting_skill', array('update_callback' => array($this, 'initialize_character')));
 }