Yoast\WP\SEO\AI_Generator\User_Interface
Ai_Generator_Integration::get_script_data
Устарела с версии 28.4. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.
Returns the data that should be passed to the script.
Метод класса: Ai_Generator_Integration{}
Хуков нет.
Возвращает
array<string|array<string>>.
Использование
$Ai_Generator_Integration = new Ai_Generator_Integration(); $Ai_Generator_Integration->get_script_data();
Список изменений
| Устарела с | 28.4 |
Код Ai_Generator_Integration::get_script_data() Ai Generator Integration::get script data Yoast 28.9
public function get_script_data() {
\_deprecated_function( __METHOD__, 'Yoast SEO 28.4' );
$user_id = $this->user_helper->get_current_user_id();
$endpoints = $this->generator_endpoints_repository->get_all_endpoints()
->merge_with(
$this->consent_endpoints_repository->get_all_endpoints(),
)->merge_with(
$this->free_sparks_endpoints_repository->get_all_endpoints(),
)->to_paths_array();
return [
'hasConsent' => $this->user_helper->get_meta( $user_id, '_yoast_wpseo_ai_consent', true ),
'productSubscriptions' => $this->get_product_subscriptions(),
'hasSeenIntroduction' => $this->introductions_seen_repository->is_introduction_seen( $user_id, AI_Fix_Assessments_Upsell::ID ),
'requestTimeout' => $this->api_client->get_request_timeout(),
'isFreeSparks' => $this->options_helper->get( 'ai_free_sparks_started_on', null ) !== null,
'endpoints' => $endpoints,
'myyoastConnection' => $this->myyoast_connection_data_presenter->present(),
];
}