$this->type, '@id' => aioseo()->schema->context['url'] . '#' . strtolower( $this->type ), 'url' => aioseo()->schema->context['url'], 'name' => aioseo()->meta->title->getTitle(), 'description' => aioseo()->schema->context['description'], 'inLanguage' => aioseo()->helpers->currentLanguageCodeBCP47(), 'isPartOf' => [ '@id' => $homeUrl . '#website' ], 'breadcrumb' => [ '@id' => aioseo()->schema->context['url'] . '#breadcrumblist' ] ]; if ( is_singular() && ! is_page() ) { $post = aioseo()->helpers->getPost(); $author = get_author_posts_url( $post->post_author ); if ( ! empty( $author ) ) { $data['author'] = $author . '#author'; $data['creator'] = $author . '#author'; } } if ( isset( aioseo()->schema->context['description'] ) && aioseo()->schema->context['description'] ) { $data['description'] = aioseo()->schema->context['description']; } if ( is_singular() ) { if ( ! isset( aioseo()->schema->context['object'] ) || ! aioseo()->schema->context['object'] ) { return $data; } $post = aioseo()->schema->context['object']; if ( has_post_thumbnail( $post ) ) { $image = $this->image( get_post_thumbnail_id(), 'mainImage' ); if ( $image ) { $data['image'] = $image; $data['primaryImageOfPage'] = [ '@id' => aioseo()->schema->context['url'] . '#mainImage' ]; } } $data['datePublished'] = mysql2date( DATE_W3C, $post->post_date_gmt, false ); $data['dateModified'] = mysql2date( DATE_W3C, $post->post_modified_gmt, false ); return $data; } if ( is_front_page() ) { $data['about'] = [ '@id' => trailingslashit( home_url() ) . '#' . aioseo()->options->searchAppearance->global->schema->siteRepresents ]; } return $data; } }