Automattic\WooCommerce\Internal\OrderReviews

Endpoint::initpublicWC 1.0

Wire the endpoint into WordPress.

Auto-called by the WC dependency container after instantiation. The title-suppression filters are deliberately NOT registered here; they land inside gate_request() once the request is confirmed to be an authorised review-order render, so they never run on unrelated pages.

Method of the class: Endpoint{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Endpoint = new Endpoint();
$Endpoint->init(): void;

Endpoint::init() code WC 11.0.1

final public function init(): void {
	// Seed the host page before `add_rewrite_rule` runs on init:10.
	add_action( 'init', array( $this, 'maybe_create_host_page' ), 4 );
	add_action( 'init', array( $this, 'add_rewrite_rule' ) );
	add_filter( 'query_vars', array( $this, 'add_query_var' ), 0 );
	add_action( 'template_redirect', array( $this, 'gate_request' ) );
	add_action( 'wp_loaded', array( $this, 'maybe_flush_pending_rewrite' ) );
	add_action( 'transition_post_status', array( $this, 'skip_auto_menu_for_self' ), 9, 3 );
	add_filter( 'get_pages', array( $this, 'exclude_self_from_page_list' ) );
	add_filter( 'display_post_states', array( $this, 'add_post_state_label' ), 10, 2 );
	// Inject our entry into every `WC_Install::create_pages()` invocation so
	// Status → Tools "Create default pages" and any other repair caller see it too.
	add_filter( 'woocommerce_create_pages', array( $this, 'inject_review_order_page' ) );
	add_shortcode( self::SHORTCODE, array( $this, 'render_shortcode' ) );
}