Yoast\WP\SEO\Presenters\Admin

Indexing_Failed_Notification_Presenter::present()publicYoast 1.0

Returns the notification as an HTML string.

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

Хуков нет.

Возвращает

Строку. The notification in an HTML string representation.

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

$Indexing_Failed_Notification_Presenter = new Indexing_Failed_Notification_Presenter();
$Indexing_Failed_Notification_Presenter->present();

Код Indexing_Failed_Notification_Presenter::present() Yoast 22.3

public function present() {
	$notification_text = \sprintf(
		/* Translators: %1$s expands to an opening anchor tag for a link leading to the Yoast SEO tools page, %2$s expands to a closing anchor tag. */
		\esc_html__(
			'Something has gone wrong and we couldn\'t complete the optimization of your SEO data. Please %1$sre-start the process%2$s.',
			'wordpress-seo'
		),
		'<a href="' . \get_admin_url( null, 'admin.php?page=wpseo_tools' ) . '">',
		'</a>'
	);

	if ( $this->product_helper->is_premium() ) {
		if ( $this->has_valid_premium_subscription() ) {
			// Add a support message for premium customers.
			$notification_text .= ' ';
			$notification_text .= \esc_html__( 'If the problem persists, please contact support.', 'wordpress-seo' );
		}
		else {
			// Premium plugin with inactive addon; overwrite the entire error message.
			$notification_text = \sprintf(
				/* Translators: %1$s expands to an opening anchor tag for a link leading to the Premium installation page, %2$s expands to a closing anchor tag. */
				\esc_html__(
					'Oops, something has gone wrong and we couldn\'t complete the optimization of your SEO data. Please make sure to activate your subscription in MyYoast by completing %1$sthese steps%2$s.',
					'wordpress-seo'
				),
				'<a href="' . \esc_url( $this->short_link_helper->get( 'https://yoa.st/3wv' ) ) . '">',
				'</a>'
			);
		}
	}

	return '<p>' . $notification_text . '</p>';
}