WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Авторские Темы для WordPress
функция не описана

WC_Admin_Addons::output_wcpay_banner_block() public WC 1.0

Handles the outputting of the WooCommerce Pay banner block.

{} Это метод класса: WC_Admin_Addons{}

Хуков нет.

Возвращает

null. Ничего.

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

$result = WC_Admin_Addons::output_wcpay_banner_block( $block );
$block(объект)
Block data.

Код WC_Admin_Addons::output_wcpay_banner_block() WC 5.4.1

<?php
public static function output_wcpay_banner_block( $block = array() ) {
	$is_active = is_plugin_active( 'woocommerce-payments/woocommerce-payments.php' );
	$location  = wc_get_base_location();

	if (
		! in_array( $location['country'], array( 'US' ), true ) ||
		$is_active ||
		! current_user_can( 'install_plugins' ) ||
		! current_user_can( 'activate_plugins' )
	) {
		return;
	}

	$button_url = wp_nonce_url(
		add_query_arg(
			array(
				'install-addon' => 'woocommerce-payments',
			)
		),
		'install-addon_woocommerce-payments'
	);

	$defaults = array(
		'image'       => WC()->plugin_url() . '/assets/images/wcpayments-icon-secure.png',
		'image_alt'   => __( 'WooCommerce Payments', 'woocommerce' ),
		'title'       => __( 'Payments made simple, with no monthly fees &mdash; exclusively for WooCommerce stores.', 'woocommerce' ),
		'description' => __( 'Securely accept cards in your store. See payments, track cash flow into your bank account, and stay on top of disputes – right from your dashboard.', 'woocommerce' ),
		'button'      => __( 'Free - Install now', 'woocommerce' ),
		'href'        => $button_url,
		'logos'       => array(),
	);

	$block_data = array_merge( $defaults, $block );
	?>
	<div class="addons-wcs-banner-block">
		<div class="addons-wcs-banner-block-image">
			<img
				class="addons-img"
				src="<?php echo esc_url( $block_data['image'] ); ?>"
				alt="<?php echo esc_attr( $block_data['image_alt'] ); ?>"
			/>
		</div>
		<div class="addons-wcs-banner-block-content">
			<h1><?php echo esc_html( $block_data['title'] ); ?></h1>
			<p><?php echo esc_html( $block_data['description'] ); ?></p>
			<?php
				self::output_button(
					$block_data['href'],
					$block_data['button'],
					'addons-button-outline-purple'
				);
			?>
		</div>
	</div>
	<?php
}