WPSEO_Premium_Upsell_Admin_Block::get_button_textprivateYoast 1.0

Returns the button text based on whether WooCommerce is active.

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

Хуков нет.

Возвращает

Строку. The button text.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_button_text( $is_woocommerce_active ): string;
$is_woocommerce_active(true|false) (обязательный)
Whether WooCommerce is active.

Код WPSEO_Premium_Upsell_Admin_Block::get_button_text() Yoast 26.3

private function get_button_text( bool $is_woocommerce_active ): string {
	if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-promotion' ) ) {
		return esc_html__( 'Get 30% off now!', 'wordpress-seo' );
	}
	else {
		// phpcs:disable Squiz.ControlStructures.InlineIfDeclaration.NotSingleLine -- needed to add translators comments.
		return $is_woocommerce_active
			/* translators: %s expands to Yoast WooCommerce SEO */
			? sprintf( esc_html__( 'Explore %s now!', 'wordpress-seo' ), 'Yoast WooCommerce SEO' )
			/* translators: %s expands to Yoast SEO Premium */
			: sprintf( esc_html__( 'Explore %s now!', 'wordpress-seo' ), 'Yoast SEO Premium' );
	}
}