Yoast\WP\SEO\Abilities\User_Interface
AI_Generate_Upsell::should_upsell
Returns whether the AI Generate upsell should be surfaced for the given input.
Premium ships AI Generate, so the upsell is limited to the free plugin, and only to writes that touch a field AI Generate could have written.
Метод класса: AI_Generate_Upsell{}
Хуков нет.
Возвращает
bool. Whether to surface the upsell.
Использование
// private - только в коде основоного (родительского) класса $result = $this->should_upsell( $input ): bool;
- $input(array<string, int|строка|true|false|null>) (обязательный)
- The ability input.
Код AI_Generate_Upsell::should_upsell() AI Generate Upsell::should upsell Yoast 28.9
private function should_upsell( array $input ): bool {
if ( $this->product_helper->is_premium() ) {
return false;
}
return \array_intersect_key( $input, \array_flip( self::AI_GENERATE_FIELDS ) ) !== [];
}