/** * Returns all public attributes of post. * * @return array Public attributes. * @since 0.1.0 */ public function getPublicAttributes() { $attrs = parent::getPublicAttributes(); $attrs['content'] = $this->rendered; if (isset($attrs['author'])) { unset($attrs['user_id']); } if (isset($attrs['category'])) { unset($attrs['category_id']); } return $attrs; }