Automattic\WooCommerce\Internal\Fulfillments

FulfillmentsRenderer::should_render_fulfillment_drawerprotectedWC 1.0

Check if the fulfillment drawer should be rendered (admin only).

Method of the class: FulfillmentsRenderer{}

No Hooks.

Returns

true|false. True if the fulfillment drawer should be rendered, false otherwise.

Usage

// protected - for code of main (parent) or child class
$result = $this->should_render_fulfillment_drawer(): bool;

FulfillmentsRenderer::should_render_fulfillment_drawer() code WC 10.3.3

protected function should_render_fulfillment_drawer(): bool {
	if ( ! is_admin() ) {
		return false;
	}

	if ( ! function_exists( 'get_current_screen' ) ) {
		return false;
	}

	$current_screen = get_current_screen();
	if ( ! $current_screen || ! $current_screen->id ) {
		return false;
	}

	return 'woocommerce_page_wc-orders' === $current_screen->id // HPOS screen.
	|| 'edit-shop_order' === $current_screen->id // Legacy screen.
	|| 'shop_order' === $current_screen->id; // Order details screen (legacy).
}