Automattic\WooCommerce\Internal\OrderReviews

Endpoint::inject_review_order_pagepublicWC 10.8.0

Append the Review Order page to any caller of WC_Install::create_pages() — keeps Status → Tools' "Create default pages" repair path and any third-party callers seeded with our page whenever the feature is on, without having to call create_pages() with a one-off filter in maybe_create_host_page().

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

Хуков нет.

Возвращает

Массив<Строку,Массив<Строку,Строку>>|Разное.

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

$Endpoint = new Endpoint();
$Endpoint->inject_review_order_page( $pages );
$pages(array<string,array<string,string>>|разное) (обязательный)
Existing page definitions.

Список изменений

С версии 10.8.0 Введена.

Код Endpoint::inject_review_order_page() WC 11.0.1

public function inject_review_order_page( $pages ) {
	if ( ! is_array( $pages ) ) {
		return $pages;
	}
	$pages[ self::PAGE_KEY ] = array(
		'name'    => _x( 'review-order', 'Page slug', 'woocommerce' ),
		'title'   => _x( 'Review your order', 'Page title', 'woocommerce' ),
		'content' => '<!-- wp:shortcode -->[' . self::SHORTCODE . ']<!-- /wp:shortcode -->',
	);
	return $pages;
}