Automattic\WooCommerce\Internal\DataStores\Orders
CustomOrdersTableController::maybe_rewrite_order_edit_link
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.
Returns
String.
Usage
$CustomOrdersTableController = new CustomOrdersTableController(); $CustomOrdersTableController->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() CustomOrdersTableController::maybe rewrite order edit link code WC 10.3.6
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;
}