on get_post_or_order_id( $post_or_order_object ) : int { if ( is_numeric( $post_or_order_object ) ) { return (int) $post_or_order_object; } elseif ( $post_or_order_object instanceof WC_Order ) { return $post_or_order_object->get_id(); } elseif ( $post_or_order_object instanceof WP_Post ) { return $post_or_order_object->ID; } return 0; } /** * Checks if passed id, post or order object is a WC_Order object. * * @param int|WP_Post|WC_Order $order_id Order ID, post object or order object. * @param string[] $types Types to match against. * * @return bool Whether the passed param is an order. */ public function is_order( $order_id, array $types = array( 'shop_order' ) ) : bool { $order_id = $this->get_post_or_order_id( $order_id ); $order_data_store = \WC_Data_Store::load( 'order' ); return in_array( $order_data_store->get_order_type( $order_id ), $types, true ); } /** * Returns type pf passed id, post or order object. * * @param int|WP_Post|WC_Order $order_id Order ID, post object or order object. * * @return string|null Type of the order. */ public function get_order_type( $order_id ) { $order_id = $this->get_post_or_order_id( $order_id ); $order_data_store = \WC_Data_Store::load( 'order' ); return $order_data_store->get_order_type( $order_id ); } /** * Get the name of the database table that's currently in use for orders. * * @return string */ public function get_table_for_orders() { if ( $this->custom_orders_table_usage_is_enabled() ) { $table_name = OrdersTableDataStore::get_orders_table_name(); } else { global $wpdb; $table_name = $wpdb->posts; } return $table_name; } /** * Get the name of the database table that's currently in use for orders. * * @return string */ public function get_table_for_order_meta() { if ( $this->custom_orders_table_usage_is_enabled() ) { $table_name = OrdersTableDataStore::get_meta_table_name(); } else { global $wpdb; $table_name = $wpdb->postmeta; } return $table_name; } }
Warning: class_implements(): Class Automattic\WooCommerce\Internal\Utilities\COTMigrationUtil does not exist and could not be loaded in /htdocs/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AbstractInterfaceServiceProvider.php on line 34

Warning: class_implements(): Class Automattic\WooCommerce\Internal\Utilities\PluginInstaller does not exist and could not be loaded in /htdocs/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AbstractInterfaceServiceProvider.php on line 34

Fatal error: Uncaught Error: Interface "Automattic\WooCommerce\Internal\RegisterHooksInterface" not found in /htdocs/wp-content/plugins/woocommerce/src/Internal/Utilities/PluginInstaller.php:21 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce/vendor/jetpack-autoloader/class-php-autoloader.php(90): require() #1 [internal function]: Automattic\Jetpack\Autoloader\jpe068848765b4c2df4244eac75f7ea46d\PHP_Autoloader::load_class('Automattic\\WooC...') #2 /htdocs/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/AbstractInterfaceServiceProvider.php(34): class_implements('Automattic\\WooC...') #3 /htdocs/wp-content/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/ServiceProviderAggregate.php(64): Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders\AbstractInterfaceServiceProvider->provides('Automattic\\WooC...') #4 /htdocs/wp-content/plugins/woocommerce/lib/packages/League/Container/Container.php(204): Automattic\WooCommerce\Vendor\League\Container\ServiceProvider\ServiceProviderAggregate->provides('Automattic\\WooC...') #5 /htdocs/wp-content/plugins/woocommerce/lib/packages/League/Container/ServiceProvider/ServiceProviderAggregate.php(28): Automattic\WooCommerce\Vendor\League\Container\Container->has('Automattic\\WooC...') #6 /htdocs/wp-content/plugins/woocommerce/lib/packages/League/Container/Container.php(146): Automattic\WooCommerce\Vendor\League\Container\ServiceProvider\ServiceProviderAggregate->add('Automattic\\WooC...') #7 /htdocs/wp-content/plugins/woocommerce/src/Container.php(109): Automattic\WooCommerce\Vendor\League\Container\Container->addServiceProvider('Automattic\\WooC...') #8 /htdocs/wp-content/plugins/woocommerce/woocommerce.php(38): Automattic\WooCommerce\Container->__construct() #9 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #10 /htdocs/wp-config.php(86): require_once('/htdocs/wp-sett...') #11 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #12 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #13 /htdocs/index.php(17): require('/htdocs/wp-blog...') #14 {main} thrown in /htdocs/wp-content/plugins/woocommerce/src/Internal/Utilities/PluginInstaller.php on line 21