Yoast\WP\SEO\Schema_Aggregator\Infrastructure\Enhancement
Article_Config::should_include_article_body
Determine if articleBody should be included
Decision logic:
- If has excerpt AND article_body_when_excerpt_exists: include
- If no excerpt AND article_body_fallback: include
- Otherwise: skip
Метод класса: Article_Config{}
Хуки из метода
Возвращает
bool. True if articleBody should be included.
Использование
$Article_Config = new Article_Config(); $Article_Config->should_include_article_body( $has_excerpt ): bool;
- $has_excerpt(true|false) (обязательный)
- Whether post has valid excerpt.
Код Article_Config::should_include_article_body() Article Config::should include article body Yoast 28.9
public function should_include_article_body( bool $has_excerpt ): bool {
if ( $has_excerpt ) {
return (bool) \apply_filters( 'wpseo_article_enhance_body_when_excerpt_exists', false );
}
return (bool) \apply_filters( 'wpseo_article_enhance_article_body_fallback', true );
}