| Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/ |
| Current File : /home/x/b/o/xbodynamge/namtation/wp-content/AmpStory.php.tar |
home/xbodynamge/dev/wp-content/plugins/all-in-one-seo-pack/app/Common/Schema/Graphs/AmpStory.php 0000644 00000002471 15114324366 0026555 0 ustar 00 <?php
namespace AIOSEO\Plugin\Common\Schema\Graphs;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* AmpStory graph class.
*
* @since 4.7.6
*/
class AmpStory extends Graph {
/**
* Returns the graph data.
*
* @since 4.7.6
*
* @return array The parsed graph data.
*/
public function get() {
$post = aioseo()->helpers->getPost();
if ( ! is_a( $post, 'WP_Post' ) || 'web-story' !== $post->post_type ) {
return [];
}
$data = [
'@type' => 'AmpStory',
'@id' => aioseo()->schema->context['url'] . '#amp-story',
'name' => aioseo()->schema->context['name'],
'headline' => get_the_title(),
'author' => [
'@id' => get_author_posts_url( $post->post_author ) . '#author'
],
'publisher' => [ '@id' => trailingslashit( home_url() ) . '#' . aioseo()->options->searchAppearance->global->schema->siteRepresents ],
'image' => $this->getFeaturedImage(),
'datePublished' => mysql2date( DATE_W3C, $post->post_date, false ),
'dateModified' => mysql2date( DATE_W3C, $post->post_modified, false ),
'inLanguage' => aioseo()->helpers->currentLanguageCodeBCP47()
];
if ( ! in_array( 'PersonAuthor', aioseo()->schema->graphs, true ) ) {
aioseo()->schema->graphs[] = 'PersonAuthor';
}
return $data;
}
} xbodynamge/namtation/wp-content/plugins/all-in-one-seo-pack/app/Common/Schema/Graphs/AmpStory.php 0000644 00000002471 15114636211 0027705 0 ustar 00 home <?php
namespace AIOSEO\Plugin\Common\Schema\Graphs;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* AmpStory graph class.
*
* @since 4.7.6
*/
class AmpStory extends Graph {
/**
* Returns the graph data.
*
* @since 4.7.6
*
* @return array The parsed graph data.
*/
public function get() {
$post = aioseo()->helpers->getPost();
if ( ! is_a( $post, 'WP_Post' ) || 'web-story' !== $post->post_type ) {
return [];
}
$data = [
'@type' => 'AmpStory',
'@id' => aioseo()->schema->context['url'] . '#amp-story',
'name' => aioseo()->schema->context['name'],
'headline' => get_the_title(),
'author' => [
'@id' => get_author_posts_url( $post->post_author ) . '#author'
],
'publisher' => [ '@id' => trailingslashit( home_url() ) . '#' . aioseo()->options->searchAppearance->global->schema->siteRepresents ],
'image' => $this->getFeaturedImage(),
'datePublished' => mysql2date( DATE_W3C, $post->post_date, false ),
'dateModified' => mysql2date( DATE_W3C, $post->post_modified, false ),
'inLanguage' => aioseo()->helpers->currentLanguageCodeBCP47()
];
if ( ! in_array( 'PersonAuthor', aioseo()->schema->graphs, true ) ) {
aioseo()->schema->graphs[] = 'PersonAuthor';
}
return $data;
}
}