e', '' ); } /** * Returns the twitter card type. * * @return string The twitter card type. */ public function generate_twitter_card() { return $this->options->get( 'twitter_card_type' ); } /** * Returns the schema page type. * * @return string|array The schema page type. */ public function generate_schema_page_type() { switch ( $this->indexable->object_type ) { case 'system-page': switch ( $this->indexable->object_sub_type ) { case 'search-result': $type = [ 'CollectionPage', 'SearchResultsPage' ]; break; default: $type = 'WebPage'; } break; case 'user': $type = 'ProfilePage'; break; case 'home-page': case 'date-archive': case 'term': case 'post-type-archive': $type = 'CollectionPage'; break; default: $type = 'WebPage'; if ( (int) \get_option( 'page_for_posts' ) === $this->indexable->object_id ) { $type = 'CollectionPage'; } } /** * Filter: 'wpseo_schema_webpage_type' - Allow changing the WebPage type. * * @api string $type The WebPage type. */ return \apply_filters( 'wpseo_schema_webpage_type', $type ); } /** * Returns the main schema id. * * The main schema id. */ public function generate_main_schema_id() { return $this->canonical . Schema_IDs::WEBPAGE_HASH; } } class_alias( Meta_Tags_Context::class, 'WPSEO_Schema_Context' );