title = $title; $this->description = $description; $this->category = $category; $this->primary_focus_keyword = $primary_focus_keyword; $this->is_cornerstone = $is_cornerstone; $this->last_modified = $last_modified; $this->schema_article_type = $schema_article_type; } /** * Returns this object in array format. * * @return array> The post as an array. */ public function to_array(): array { $data = [ 'title' => $this->title, 'description' => $this->description, 'category' => isset( $this->category ) ? $this->category->to_array() : null, 'primary_focus_keyword' => $this->primary_focus_keyword, 'is_cornerstone' => $this->is_cornerstone, 'last_modified' => $this->last_modified, ]; if ( isset( $this->schema_article_type ) ) { $data['schema_article_type'] = $this->schema_article_type; } return $data; } /** * Returns the minimal array representation suitable for the REST response. * * Only includes fields the frontend round-trips into the get_outline call. * Excludes editor-only metadata (focus keyphrase, cornerstone, schema type) * that must not cross the REST boundary. * * @return array The minimal post payload. */ public function to_minimal_array(): array { return [ 'title' => $this->title, 'description' => $this->description, ]; } }