WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта с помощью браузерных PUSH уведомлений
функция не описана

Automattic\WooCommerce\Admin\API

OnboardingTasks::get_homepage_cover_block() private WC 1.0

Returns a valid cover block with an image, if one exists, or background as a fallback.

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

Хуков нет.

Возвращает

Строку. Block content.

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

$result = OnboardingTasks::get_homepage_cover_block( $image );
$image(массив) (обязательный)
Image to use for the cover block. Should contain a media ID and image URL.

Код OnboardingTasks::get_homepage_cover_block() WC 5.2.2

<?php
private static function get_homepage_cover_block( $image ) {
	$shop_url = get_permalink( wc_get_page_id( 'shop' ) );
	if ( ! empty( $image['url'] ) && ! empty( $image['id'] ) ) {
		return '<!-- wp:cover {"url":"' . esc_url( $image['url'] ) . '","id":' . intval( $image['id'] ) . ',"dimRatio":0} -->
		<div class="wp-block-cover" style="background-image:url(' . esc_url( $image['url'] ) . ')"><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"' . __( 'Write title…', 'woocommerce' ) . '","textColor":"white","fontSize":"large"} -->
		<p class="has-text-align-center has-large-font-size">' . __( 'Welcome to the store', 'woocommerce' ) . '</p>
		<!-- /wp:paragraph -->

		<!-- wp:paragraph {"align":"center","textColor":"white"} -->
		<p class="has-text-color has-text-align-center">' . __( 'Write a short welcome message here', 'woocommerce' ) . '</p>
		<!-- /wp:paragraph -->

		<!-- wp:button {"align":"center"} -->
		<div class="wp-block-button aligncenter"><a href="' . esc_url( $shop_url ) . '" class="wp-block-button__link">' . __( 'Go shopping', 'woocommerce' ) . '</a></div>
		<!-- /wp:button --></div></div>
		<!-- /wp:cover -->';
	}