����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace Yoast\WP\SEO\Generators\Schema;
use WP_Post;
use Yoast\WP\SEO\Config\Schema_IDs;
/**
* Returns schema WebPage data.
*/
class WebPage extends Abstract_Schema_Piece {
/**
* Determines whether or not a piece should be added to the graph.
*
* @return bool
*/
public function is_needed() {
if ( $this->context->indexable->object_type === 'unknown' ) {
return false;
}
return ! ( $this->context->indexable->object_type === 'system-page' && $this->context->indexable->object_sub_type === '404' );
}
/**
* Returns WebPage schema data.
*
* @return array WebPage schema data.
*/
public function generate() {
$data = [
'@type' => $this->context->schema_page_type,
'@id' => $this->context->main_schema_id,
'url' => $this->context->canonical,
'name' => $this->helpers->schema->html->smart_strip_tags( $this->context->title ),
'isPartOf' => [
'@id' => $this->context->site_url . Schema_IDs::WEBSITE_HASH,
],
];
if ( empty( $this->context->canonical ) && \is_search() ) {
$data['url'] = $this->build_search_url();
}
if ( $this->helpers->current_page->is_front_page() ) {
if ( $this->context->site_represents_reference ) {
$data['about'] = $this->context->site_represents_reference;
}
}
$this->add_image( $data );
if ( $this->context->indexable->object_type === 'post' ) {
$data['datePublished'] = $this->helpers->date->format( $this->context->post->post_date_gmt );
$data['dateModified'] = $this->helpers->date->format( $this->context->post->post_modified_gmt );
if ( $this->context->indexable->object_sub_type === 'post' ) {
$data = $this->add_author( $data, $this->context->post );
}
}
if ( ! empty( $this->context->description ) ) {
$data['description'] = $this->helpers->schema->html->smart_strip_tags( $this->context->description );
}
if ( $this->add_breadcrumbs() ) {
$data['breadcrumb'] = [
'@id' => $this->context->canonical . Schema_IDs::BREADCRUMB_HASH,
];
}
if ( ! empty( $this->context->main_entity_of_page ) ) {
$data['mainEntity'] = $this->context->main_entity_of_page;
}
$data = $this->helpers->schema->language->add_piece_language( $data );
$data = $this->add_potential_action( $data );
return $data;
}
/**
* Adds an author property to the $data if the WebPage is not represented.
*
* @param array $data The WebPage schema.
* @param WP_Post $post The post the context is representing.
*
* @return array The WebPage schema.
*/
public function add_author( $data, $post ) {
if ( $this->context->site_represents === false ) {
$data['author'] = [ '@id' => $this->helpers->schema->id->get_user_schema_id( $post->post_author, $this->context ) ];
}
return $data;
}
/**
* If we have an image, make it the primary image of the page.
*
* @param array $data WebPage schema data.
*/
public function add_image( &$data ) {
if ( $this->context->has_image ) {
$data['primaryImageOfPage'] = [ '@id' => $this->context->canonical . Schema_IDs::PRIMARY_IMAGE_HASH ];
$data['image'] = [ '@id' => $this->context->canonical . Schema_IDs::PRIMARY_IMAGE_HASH ];
$data['thumbnailUrl'] = $this->context->main_image_url;
}
}
/**
* Determine if we should add a breadcrumb attribute.
*
* @return bool
*/
private function add_breadcrumbs() {
if ( $this->context->indexable->object_type === 'system-page' && $this->context->indexable->object_sub_type === '404' ) {
return false;
}
return true;
}
/**
* Adds the potential action property to the WebPage Schema piece.
*
* @param array $data The WebPage data.
*
* @return array The WebPage data with the potential action added.
*/
private function add_potential_action( $data ) {
$url = $this->context->canonical;
if ( $data['@type'] === 'CollectionPage' || ( \is_array( $data['@type'] ) && \in_array( 'CollectionPage', $data['@type'], true ) ) ) {
return $data;
}
/**
* Filter: 'wpseo_schema_webpage_potential_action_target' - Allows filtering of the schema WebPage potentialAction target.
*
* @api array $targets The URLs for the WebPage potentialAction target.
*/
$targets = \apply_filters( 'wpseo_schema_webpage_potential_action_target', [ $url ] );
$data['potentialAction'][] = [
'@type' => 'ReadAction',
'target' => $targets,
];
return $data;
}
/**
* Creates the search URL for use when if there is no canonical.
*
* @return string Search URL.
*/
private function build_search_url() {
return $this->context->site_url . '?s=' . \get_search_query();
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| abstract-schema-piece.php | File | 794 B | 0644 |
|
| article.php | File | 7.12 KB | 0644 |
|
| author.php | File | 2.95 KB | 0644 |
|
| breadcrumb.php | File | 5.05 KB | 0644 |
|
| faq.php | File | 2.89 KB | 0644 |
|
| howto.php | File | 4.91 KB | 0644 |
|
| main-image.php | File | 1.14 KB | 0644 |
|
| organization.php | File | 2.51 KB | 0644 |
|
| person.php | File | 9.09 KB | 0644 |
|
| webpage.php | File | 4.53 KB | 0644 |
|
| website.php | File | 2.6 KB | 0644 |
|