SimpleCalendarWidgets

Widgets.

Defined (1)

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

/includes/widgets.php  
  1. class Widgets { 
  2.  
  3. /** 
  4. * Widgets. 
  5. * @access public 
  6. * @var array 
  7. */ 
  8. public $widgets = array(); 
  9.  
  10. /** 
  11. * Register new widgets. 
  12. * @since 3.0.0 
  13. */ 
  14. public function __construct() { 
  15.  
  16. $this->widgets = apply_filters( 'simcal_get_widgets', array( 
  17. 'SimpleCalendar\Widgets\Calendar' 
  18. ), array() ); 
  19.  
  20. add_action( 'widgets_init', array( $this, 'register' ) ); 
  21.  
  22. /** 
  23. * Register widgets. 
  24. * @since 3.0.0 
  25. */ 
  26. public function register() { 
  27.  
  28. $widgets = $this->widgets; 
  29.  
  30. if ( ! empty( $widgets ) && is_array( $widgets ) ) { 
  31. foreach ( $widgets as $widget ) { 
  32. register_widget( $widget ); 
  33.  
  34. do_action( 'simcal_register_widgets' ); 
  35.