WC_Queue::validate_instance( WC_Queue_Interface $instance )
Enforce a WC_Queue_Interface
Description Description
Parameters Parameters
- $instance
-
(Required) Instance class.
Return Return
(WC_Queue_Interface)
Source Source
File: includes/queue/class-wc-queue.php
protected static function validate_instance( $instance ) {
if ( false === ( $instance instanceof WC_Queue_Interface ) ) {
$default_class = self::$default_cass;
/* translators: %s: Default class name */
wc_doing_it_wrong( __FUNCTION__, sprintf( __( 'The class attached to the "woocommerce_queue_class" does not implement the WC_Queue_Interface interface. The default %s class will be used instead.', 'woocommerce' ), $default_class ), '3.5.0' );
$instance = new $default_class();
}
return $instance;
}