true, 'use_excerpt' => true, 'keywords' => true, ]; $default = ( $defaults[ $enhancement ] ?? false ); return (bool) \apply_filters( "wpseo_article_enhance_{$enhancement}", $default ); } /** * 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 * * @param bool $has_excerpt Whether post has valid excerpt. * * @return bool True if articleBody should be included. */ 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 ); } }