Skip to content

Commit

Permalink
Add HPOS filters for order colums
Browse files Browse the repository at this point in the history
  • Loading branch information
inpsyde-maticluznar committed Nov 17, 2023
1 parent dba1e1b commit 001dee4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/MerchantCapture/OrderListPaymentColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Mollie\WooCommerce\MerchantCapture;

use Automattic\WooCommerce\Admin\Overrides\Order;
use Mollie\WooCommerce\MerchantCapture\UI\StatusRenderer;

class OrderListPaymentColumn
Expand All @@ -12,6 +13,12 @@ public function __construct()
{
add_filter('manage_edit-shop_order_columns', [$this, 'renderColumn']);
add_action('manage_shop_order_posts_custom_column', [$this, 'renderColumnValue'], 10, 2);

# HPOS hooks
add_filter('woocommerce_shop_order_list_table_columns', [$this, 'renderColumn']);
add_action('woocommerce_shop_order_list_table_custom_column', function (string $column, Order $order) {
$this->renderColumnValue($column, $order->get_id());
}, 10, 2);
}

public function renderColumn(array $columns): array
Expand Down

0 comments on commit 001dee4

Please sign in to comment.