Yoast\WP\SEO\Presenters\Admin

Indexing_Error_Presenter::generate_first_paragraph()protectedYoast 1.0

Generates the first paragraph of the error message to show when indexing failed.

The contents of the paragraph varies based on whether WordPress SEO Premium has a valid, activated subscription or not.

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

Хуков нет.

Возвращает

Строку.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->generate_first_paragraph( $is_premium, $has_valid_premium_subscription );
$is_premium(true|false) (обязательный)
Whether WordPress SEO Premium is currently active.
$has_valid_premium_subscription(true|false) (обязательный)
Whether WordPress SEO Premium currently has a valid subscription.

Код Indexing_Error_Presenter::generate_first_paragraph() Yoast 22.4

protected function generate_first_paragraph( $is_premium, $has_valid_premium_subscription ) {
	$message = \__(
		'Oops, something has gone wrong and we couldn\'t complete the optimization of your SEO data. Please click the button again to re-start the process. ',
		'wordpress-seo'
	);

	if ( $is_premium ) {
		if ( $has_valid_premium_subscription ) {
			$message .= \__( 'If the problem persists, please contact support.', 'wordpress-seo' );
		}
		else {
			$message = \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. */
				\__(
					'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 $message;
}