wpseo_article_enhance_body_when_excerpt_exists
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
Использование
add_filter( 'wpseo_article_enhance_body_when_excerpt_exists', 'wp_kama_wpseo_article_enhance_body_when_excerpt_exists_filter' );
/**
* Function for `wpseo_article_enhance_body_when_excerpt_exists` filter-hook.
*
* @param bool $has_excerpt Whether post has valid excerpt.
*
* @return bool
*/
function wp_kama_wpseo_article_enhance_body_when_excerpt_exists_filter( $has_excerpt ){
// filter...
return $has_excerpt;
}
- $has_excerpt(true|false)
- Whether post has valid excerpt.
Где вызывается хук
wpseo_article_enhance_body_when_excerpt_exists
yoast/src/schema-aggregator/infrastructure/enhancement/article-config.php 59
return (bool) \apply_filters( 'wpseo_article_enhance_body_when_excerpt_exists', false );