Automattic\WooCommerce\Internal\OrderReviews

Endpoint::inject_review_order_page │ public │ WC 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. maybe_create_host_page() relies on this injection too, layering its own scoping filter on top so its internal repair creates only this page.

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

Хуков нет.

Возвращает

array<string,array<string,string>>|mixed.

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

$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.2.2

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;
}