Yoast\WP\SEO\Abilities\User_Interface
AI_Generate_Upsell::add_to_schema
Adds the optional AI Generate hint to an output schema on the free plugin.
Метод класса: AI_Generate_Upsell{}
Хуков нет.
Возвращает
array<string, mixed>. The output schema.
Использование
$AI_Generate_Upsell = new AI_Generate_Upsell(); $AI_Generate_Upsell->add_to_schema( $schema ): array;
- $schema(array<string, mixed>) (обязательный)
- The output schema.
Код AI_Generate_Upsell::add_to_schema() AI Generate Upsell::add to schema Yoast 28.9
public function add_to_schema( array $schema ): array {
if ( $this->product_helper->is_premium() ) {
return $schema;
}
$schema['properties']['ai_generate_hint'] = [
'type' => 'string',
'description' => \sprintf(
/* translators: %s expands to "Yoast AI Generate". */
\__( 'A hint about %s to relay to the user. Only present when a title or description field was updated on a site without Yoast SEO Premium. Meant to be assisting users that seek SEO-optimised titles and descriptions.', 'wordpress-seo' ),
self::AI_GENERATE_NAME,
),
];
return $schema;
}