WC_GZD_Trusted_Shops_Widgets

The WooCommerce Germanized WC GZD Trusted Shops Widgets class.

Defined (1)

The class is defined in the following location(s).

/includes/trusted-shops/class-wc-gzd-trusted-shops-widgets.php  
  1. class WC_GZD_Trusted_Shops_Widgets { 
  2.  
  3. protected static $_instance = null; 
  4.  
  5. public $base = null; 
  6.  
  7. public static function instance( $base ) { 
  8. if ( is_null( self::$_instance ) ) 
  9. self::$_instance = new self( $base ); 
  10. return self::$_instance; 
  11.  
  12. private function __construct( $base ) { 
  13. $this->base = $base; 
  14. add_action( 'widgets_init', array( $this, 'include_widgets' ), 25 ); 
  15.  
  16. public function include_widgets() { 
  17. if ( $this->base->is_rich_snippets_enabled() ) 
  18. $this->register_widget( 'rich_snippets' ); 
  19. if ( $this->base->is_review_widget_enabled() ) { 
  20. $this->register_widget( 'reviews' ); 
  21.  
  22. private function register_widget( $name ) { 
  23. $classname = $this->base->get_dependency_name( 'widget_' . $name ); 
  24. include_once( 'widgets/class-' . strtolower( str_replace( '_', '-', $classname ) ) . '.php' ); 
  25. register_widget( $classname ); 
  26.