From f03821904be427ab4b787e39ad656693a2edba57 Mon Sep 17 00:00:00 2001 From: Jeremy Pry Date: Mon, 14 Aug 2023 18:25:25 -0400 Subject: [PATCH] Create an interface for classes that need to register hooks --- .../src/Internal/Admin/Orders/Edit.php | 6 ++++-- .../src/Internal/RegisterHooksInterface.php | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 plugins/woocommerce/src/Internal/RegisterHooksInterface.php diff --git a/plugins/woocommerce/src/Internal/Admin/Orders/Edit.php b/plugins/woocommerce/src/Internal/Admin/Orders/Edit.php index a39300e9679..3a6c40c73c4 100644 --- a/plugins/woocommerce/src/Internal/Admin/Orders/Edit.php +++ b/plugins/woocommerce/src/Internal/Admin/Orders/Edit.php @@ -1,6 +1,8 @@ output( $order ); }, $screen_id, @@ -247,7 +249,7 @@ class Edit { 'woocommerce-customer-history', __( 'Customer History', 'woocommerce' ), function( $post_or_order ) use ( $customer_history_meta_box ) { - $order = $post_or_order instanceof WC_Order ?: wc_get_order( $post_or_order ); + $order = $post_or_order instanceof WC_Order ? $post_or_order : wc_get_order( $post_or_order ); $customer_history_meta_box->output( $order ); }, $screen_id, diff --git a/plugins/woocommerce/src/Internal/RegisterHooksInterface.php b/plugins/woocommerce/src/Internal/RegisterHooksInterface.php new file mode 100644 index 00000000000..3c0d7f285d4 --- /dev/null +++ b/plugins/woocommerce/src/Internal/RegisterHooksInterface.php @@ -0,0 +1,20 @@ +