Yoast\WP\SEO\AI_Generator\User_Interface
Ai_Generator_Integration::get_script_data
Returns the data that should be passed to the script.
Метод класса: Ai_Generator_Integration{}
Хуков нет.
Возвращает
Массив<Строку|Массив<Строку>>.
Использование
$Ai_Generator_Integration = new Ai_Generator_Integration(); $Ai_Generator_Integration->get_script_data();
Код Ai_Generator_Integration::get_script_data() Ai Generator Integration::get script data Yoast 27.7
public function get_script_data() {
$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,
];
}