PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.7
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.7
4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 4.2.1 All 138 releases
learnpress / inc / Widgets / Course / FilterCourseWidget.php

FilterCourseWidget.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.7, at inc/Widgets/Course/FilterCourseWidget.php

50 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace LearnPress\Widgets\Course;
4 use LearnPress\Widgets\LPWidgetBase;
5
6 /**
7 * Class AbstractWidget
8 *
9 * @package LearnPress\Widgets
10 * @since 4.2.3.2
11 * @version 1.0.0
12 */
13 class FilterCourseWidget extends LPWidgetBase {
14 public $lp_widget_id = 'course_filter';
15 public $lp_widget_class = 'lp-widget-course-filter';
16
17 public function __construct() {
18 $this->lp_widget_name = __( 'LearnPress - Course Filter', 'learnpress' );
19 $this->lp_widget_description = __( 'Widget Course Filter', 'learnpress' );
20 parent::__construct();
21 }
22
23 public function widget( $args, $instance ) {
24 $title = $instance['title'] ?? '';
25 $content = $instance['content'] ?? '';
26
27 echo $args['before_widget'];
28 echo '<h2 class="widget-title">' . $title . '</h2>';
29 echo '<p>' . $content . '</p>';
30 echo $args['after_widget'];
31 }
32
33 public function form( $instance ) {
34 $title = esc_attr( $instance['title'] ?? '' );
35 $content = esc_textarea( $instance['content'] ?? '' );
36
37 ?>
38 <p>
39 <label for="<?php echo $this->get_field_id( 'title' ); ?>">Title:</label>
40 <input type="text" name="<?php echo $this->get_field_name( 'title' ); ?>" id="<?php echo $this->get_field_id( 'title' ); ?>" value="<?php echo $title; ?>" class="widefat" />
41 </p>
42 <p>
43 <label for="<?php echo $this->get_field_id( 'content' ); ?>">Content:</label>
44 <textarea name="<?php echo $this->get_field_name( 'content' ); ?>" id="<?php echo $this->get_field_id( 'content' ); ?>" class="widefat"><?php echo $content; ?></textarea>
45 </p>
46 <?php
47 }
48 }
49
50