Automattic\WooCommerce\Internal\OrderReviews
Endpoint::inject_review_order_page
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().
Method of the class: Endpoint{}
No Hooks.
Returns
Array
Usage
$Endpoint = new Endpoint(); $Endpoint->inject_review_order_page( $pages );
- $pages(array<string,array<string,string>>|mixed) (required)
- Existing page definitions.
Changelog
| Since 10.8.0 | Introduced. |
Endpoint::inject_review_order_page() Endpoint::inject review order page code WC 10.8.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;
}