wc_order_util_class_object = $this->get_wc_order_util_class(); } public function get_wc_order_util_class() { if ( class_exists( '\Automattic\WooCommerce\Utilities\OrderUtil' ) ) { return \Automattic\WooCommerce\Utilities\OrderUtil::class; } else { return false; } } public function get_order_type( $order_id ) { if ( $this->wc_order_util_class_object && is_callable( [ $this->wc_order_util_class_object, 'get_order_type' ] ) ) { return $this->wc_order_util_class_object::get_order_type( intval( $order_id ) ); } else { return get_post_type( intval( $order_id ) ); } } public function custom_orders_table_usage_is_enabled() { if ( $this->wc_order_util_class_object && is_callable( [ $this->wc_order_util_class_object, 'custom_orders_table_usage_is_enabled' ] ) ) { return $this->wc_order_util_class_object::custom_orders_table_usage_is_enabled(); } else { return false; } } public function is_wc_admin_page() { return class_exists( 'Automattic\WooCommerce\Admin\PageController' ) && is_callable( array( '\\Automattic\\WooCommerce\\Admin\\PageController', 'is_admin_or_embed_page' ) ) && \Automattic\WooCommerce\Admin\PageController::is_admin_or_embed_page(); } } endif; // Class exists check