Yoast\WP\SEO\AI_Generator\User_Interface

Ai_Generator_Integration::get_myyoast_connection_data │ public │ Yoast 1.0

Устарела с версии 28.4. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.

Builds the read-only MyYoast connection payload used to pick the "Yoast AI cannot reach your site" notification variant in the editor.

Returns null when the feature flag is disabled, so the editor treats the connection as unavailable and shows the informational-only variant. The payload is deliberately minimal — no store, actions, or tokens reach the editor; the connect call-to-action is just a nonce-protected link that auto-starts the flow on the Integrations page in a new tab.

Метод класса: Ai_Generator_Integration{}

Хуков нет.

Возвращает

array{isProvisioned: bool, canConnect: bool, connectUrl: string|null, learnMoreUrl: string}|null.

Использование

$Ai_Generator_Integration = new Ai_Generator_Integration();
$Ai_Generator_Integration->get_myyoast_connection_data();

Список изменений

Устарела с 28.4

Код Ai_Generator_Integration::get_myyoast_connection_data() Yoast 28.7

public function get_myyoast_connection_data() {
	\_deprecated_function( __METHOD__, 'Yoast SEO 28.4' );
	if ( ! $this->myyoast_connection_conditional->is_met() ) {
		return null;
	}

	$status      = $this->status_presenter->present();
	$can_connect = $this->connection_permission->can_manage();

	return [
		'isProvisioned' => \is_bool( $status['is_provisioned'] ) && $status['is_provisioned'],
		'canConnect'    => $can_connect,
		// Only users who can manage options can start the flow; for everyone
		// else the link is omitted and the editor shows the "ask your admin" variant.
		'connectUrl'    => ( $can_connect ) ? $this->get_connect_url() : null,
		'learnMoreUrl'  => $this->short_link_helper->get( 'https://yoa.st/ai-myyoast-connection' ),
	];
}