Automattic\WooCommerce\Internal\DataStores\Orders

CustomOrdersTableController::maybe_rewrite_order_edit_link()privateWC 9.0.0

Rewrites post edit links for HPOS placeholder posts so that they go to the HPOS order itself. Hooked onto get_edit_post_link.

Method of the class: CustomOrdersTableController{}

No Hooks.

Return

String.

Usage

// private - for code of main (parent) class only
$result = $this->maybe_rewrite_order_edit_link( $link, $post_id );
$link(string) (required)
The edit link.
$post_id(int) (required)
Post ID.

Changelog

Since 9.0.0 Introduced.

CustomOrdersTableController::maybe_rewrite_order_edit_link() code WC 9.3.3

private function maybe_rewrite_order_edit_link( $link, $post_id ) {
	if ( DataSynchronizer::PLACEHOLDER_ORDER_POST_TYPE === get_post_type( $post_id ) ) {
		$link = OrderUtil::get_order_admin_edit_url( $post_id );
	}

	return $link;
}