| 1 |
<?php |
| 2 |
|
| 3 |
namespace LearnPress\Widgets; |
| 4 |
|
| 5 |
use LearnPress\Helpers\Singleton; |
| 6 |
|
| 7 |
/** |
| 8 |
* Class AbstractWidget |
| 9 |
* |
| 10 |
* @package LearnPress\Widgets |
| 11 |
* @since 4.2.3.2 |
| 12 |
* @version 1.0.0 |
| 13 |
*/ |
| 14 |
class LPRegisterWidget { |
| 15 |
use Singleton; |
| 16 |
|
| 17 |
protected function init() { |
| 18 |
add_action( 'widgets_init', array( $this, 'register_widgets' ) ); |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* Register widgets of LearnPress. |
| 23 |
* |
| 24 |
* @return void |
| 25 |
*/ |
| 26 |
public function register_widgets() { |
| 27 |
$widgets = apply_filters( |
| 28 |
'learn-press/widgets/register', |
| 29 |
[ |
| 30 |
//FilterCourseWidget::class, |
| 31 |
] |
| 32 |
); |
| 33 |
|
| 34 |
foreach ( $widgets as $widget ) { |
| 35 |
register_widget( $widget ); |
| 36 |
} |
| 37 |
|
| 38 |
} |
| 39 |
} |
| 40 |
|
| 41 |
|