Automattic\WooCommerce\Internal\DataStores\Orders

CustomOrdersTableController::maybe_rewrite_order_edit_link │ public │ WC 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.

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

Хуков нет.

Возвращает

string.

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

$CustomOrdersTableController = new CustomOrdersTableController();
$CustomOrdersTableController->maybe_rewrite_order_edit_link( $link, $post_id );
$link(строка) (обязательный)
The edit link.
$post_id(int) (обязательный)
Post ID.

Список изменений

С версии 9.0.0 Введена.

Код CustomOrdersTableController::maybe_rewrite_order_edit_link() WC 11.3.0

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