WC_Queue::validate_instance()
Enforce a WC_Queue_Interface
Method of the class: WC_Queue{}
No Hooks.
Return
WC_Queue_Interface
.
Usage
$result = WC_Queue::validate_instance( $instance );
- $instance(WC_Queue_Interface) (required)
- Instance class.
WC_Queue::validate_instance() WC Queue::validate instance code WC 9.5.1
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; }