Yoast\WP\SEO\Presentations
Indexable_Post_Type_Presentation::generate_open_graph_description
Generates the open graph description.
Метод класса: Indexable_Post_Type_Presentation{}
Хуков нет.
Возвращает
Строку. The open graph description.
Использование
$Indexable_Post_Type_Presentation = new Indexable_Post_Type_Presentation(); $Indexable_Post_Type_Presentation->generate_open_graph_description();
Код Indexable_Post_Type_Presentation::generate_open_graph_description() Indexable Post Type Presentation::generate open graph description Yoast 28.0
public function generate_open_graph_description() {
if ( $this->model->open_graph_description ) {
$open_graph_description = $this->model->open_graph_description;
}
if ( empty( $open_graph_description ) ) {
// The helper applies a filter, but we don't have a default value at this stage so we pass an empty string.
$open_graph_description = $this->values_helper->get_open_graph_description( '', $this->model->object_type, $this->model->object_sub_type );
}
if ( empty( $open_graph_description ) ) {
$open_graph_description = $this->meta_description;
}
if ( empty( $open_graph_description ) ) {
$open_graph_description = $this->post->get_the_excerpt( $this->model->object_id );
$open_graph_description = $this->post->strip_shortcodes( $open_graph_description );
}
return $open_graph_description;
}