Automattic\WooCommerce\Internal\Admin

Loader::embed_page_header()public staticWC 1.0

Set up a div for the header embed to render into. The initial contents here are meant as a place loader for when the PHP page initialy loads.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$result = Loader::embed_page_header();

Код Loader::embed_page_header() WC 8.9.3

<?php
public static function embed_page_header() {
	if ( ! PageController::is_admin_page() && ! PageController::is_embed_page() ) {
		return;
	}

	if ( ! PageController::is_embed_page() ) {
		return;
	}

	$sections = self::get_embed_breadcrumbs();
	$sections = is_array( $sections ) ? $sections : array( $sections );

	$page_title      = '';
	$pages_with_tabs = array( 'Settings', 'Reports', 'Status' );

	if (
		count( $sections ) > 2 &&
		is_array( $sections[1] ) &&
		in_array( $sections[1][1], $pages_with_tabs, true )
	) {
		$page_title = $sections[1][1];
	} else {
		$page_title = end( $sections );
	}
	?>
	<div id="woocommerce-embedded-root" class="is-embed-loading">
		<div class="woocommerce-layout">
			<div class="woocommerce-layout__header is-embed-loading">
				<h1 class="woocommerce-layout__header-heading">
					<?php self::output_heading( $page_title ); ?>
				</h1>
			</div>
		</div>
	</div>
	<?php
}