Yoast\WP\SEO\Presentations

Indexable_Post_Type_Presentation::generate_open_graph_article_published_time()publicYoast 1.0

Generates the open graph article published time.

Метод класса: Indexable_Post_Type_Presentation{}

Хуки из метода

Возвращает

Строку. The open graph article published time.

Использование

$Indexable_Post_Type_Presentation = new Indexable_Post_Type_Presentation();
$Indexable_Post_Type_Presentation->generate_open_graph_article_published_time();

Код Indexable_Post_Type_Presentation::generate_open_graph_article_published_time() Yoast 22.4

public function generate_open_graph_article_published_time() {
	if ( $this->model->object_sub_type !== 'post' ) {
		/**
		 * Filter: 'wpseo_opengraph_show_publish_date' - Allow showing publication date for other post types.
		 *
		 * @param bool   $show      Whether or not to show publish date.
		 * @param string $post_type The current URL's post type.
		 */
		if ( ! \apply_filters( 'wpseo_opengraph_show_publish_date', false, $this->post->get_post_type( $this->source ) ) ) {
			return '';
		}
	}

	return $this->date->format( $this->source->post_date_gmt );
}