frontend/web/blog/wp-content/plugins/wordpress-seo/frontend/schema/class-schema-webpage.php
/**
	 * Returns WebPage schema data.
	 *
	 * @return array WebPage schema data.
	 */
Returns WebPage schema data.
@return array WebPage schema data.
Returns WebPage schema data . @return array WebPage schema data .
public function generate() {
		$data = [
			'@type'    => $this->determine_page_type(),
			'@id'      => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH,
			'url'      => $this->context->canonical,
			'name'     => $this->context->title,
			'isPartOf' => [
				'@id' => $this->context->site_url . WPSEO_Schema_IDs::WEBSITE_HASH,
			],
		];
		$data = WPSEO_Schema_Utils::add_piece_language( $data );
		if ( is_front_page() ) {
			if ( $this->context->site_represents_reference ) {
				$data['about'] = $this->context->site_represents_reference;
			}
		}
		if ( is_singular() ) {
			$this->add_image( $data );
			$post                  = get_post( $this->context->id );
			$data['datePublished'] = $this->date->format( $post->post_date_gmt );
			$data['dateModified']  = $this->date->format( $post->post_modified_gmt );
			if ( get_post_type( $post ) === 'post' ) {
				$data = $this->add_author( $data, $post );
			}
		}
		if ( ! empty( $this->context->description ) ) {
			$data['description'] = strip_tags( $this->context->description, '<h1><h2><h3><h4><h5><h6><br><ol><ul><li><a><p><b><strong><i><em>' );
		}
		if ( $this->add_breadcrumbs() ) {
			$data['breadcrumb'] = [
				'@id' => $this->context->canonical . WPSEO_Schema_IDs::BREADCRUMB_HASH,
			];
		}
		return $data;
	}
public function generate ( ) { $ data = [ '@type' => $ this -> determine_page_type ( ) , '@id' => $ this -> context -> canonical . WPSEO_Schema_IDs :: WEBPAGE_HASH , 'url' => $ this -> context -> canonical , 'name' => $ this -> context -> title , 'isPartOf' => [ '@id' => $ this -> context -> site_url . WPSEO_Schema_IDs :: WEBSITE_HASH , ] , ] ; $ data = WPSEO_Schema_Utils :: add_piece_language ( $ data ) ; if ( is_front_page ( ) ) { if ( $ this -> context -> site_represents_reference ) { $ data [ 'about' ] = $ this -> context -> site_represents_reference ; } } if ( is_singular ( ) ) { $ this -> add_image ( $ data ) ; $ post = get_post ( $ this -> context -> id ) ; $ data [ 'datePublished' ] = $ this -> date -> format ( $ post -> post_date_gmt ) ; $ data [ 'dateModified' ] = $ this -> date -> format ( $ post -> post_modified_gmt ) ; if ( get_post_type ( $ post ) === 'post' ) { $ data = $ this -> add_author ( $ data , $ post ) ; } } if ( ! empty ( $ this -> context -> description ) ) { $ data [ 'description' ] = strip_tags ( $ this -> context -> description , '<h1><h2><h3><h4><h5><h6><br><ol><ul><li><a><p><b><strong><i><em>' ) ; } if ( $ this -> add_breadcrumbs ( ) ) { $ data [ 'breadcrumb' ] = [ '@id' => $ this -> context -> canonical . WPSEO_Schema_IDs :: BREADCRUMB_HASH , ] ; } return $ data ; }
Returns WebPage schema data.
Returns WebPage schema data .