Yoast\WP\SEO\Schema_Aggregator\Infrastructure\Enhancement

Article_Config::should_include_article_body │ public │ Yoast 1.0

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() 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 );
}