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

WC_Admin_Addons::output_promotion_block() public WC 1.0

Handles the output of a full-width block.

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

Хуков нет.

Возвращает

null. Ничего.

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

$result = WC_Admin_Addons::output_promotion_block( $section );
$section(массив) (обязательный)
Section data.

Код WC_Admin_Addons::output_promotion_block() WC 5.4.1

<?php
public static function output_promotion_block( $section ) {
	if (
		! current_user_can( 'install_plugins' ) ||
		! current_user_can( 'activate_plugins' )
	) {
		return;
	}

	$section_object = (object) $section;

	if ( ! empty( $section_object->geowhitelist ) ) {
		$section_object->geowhitelist = explode( ',', $section_object->geowhitelist );
	}

	if ( ! empty( $section_object->geoblacklist ) ) {
		$section_object->geoblacklist = explode( ',', $section_object->geoblacklist );
	}

	if ( ! self::show_extension( $section_object ) ) {
		return;
	}

	?>
	<div class="addons-banner-block addons-promotion-block">
		<img
			class="addons-img"
			src="<?php echo esc_url( $section['image'] ); ?>"
			alt="<?php echo esc_attr( $section['image_alt'] ); ?>"
		/>
		<div class="addons-promotion-block-content">
			<h1 class="addons-promotion-block-title"><?php echo esc_html( $section['title'] ); ?></h1>
			<div class="addons-promotion-block-description">
				<?php echo wp_kses_post( $section['description'] ); ?>
			</div>
			<div class="addons-promotion-block-buttons">
				<?php

				if ( $section['button_1'] ) {
					self::output_button(
						$section['button_1_href'],
						$section['button_1'],
						'addons-button-expandable addons-button-solid',
						$section['plugin']
					);
				}

				if ( $section['button_2'] ) {
					self::output_button(
						$section['button_2_href'],
						$section['button_2'],
						'addons-button-expandable addons-button-outline-purple',
						$section['plugin']
					);
				}

				?>
			</div>
		</div>
	</div>
	<?php
}