@@ -10,8 +10,8 @@ |
||
| 10 | 10 | * @author WooThemes |
| 11 | 11 | * @since 1.0.0 |
| 12 | 12 | */ |
| 13 | -if( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) exit(); |
|
| 13 | +if ( ! defined('WP_UNINSTALL_PLUGIN')) exit(); |
|
| 14 | 14 | |
| 15 | 15 | $token = 'woothemes-sensei'; |
| 16 | -delete_option( 'skip_install_sensei_pages' ); |
|
| 17 | -delete_option( 'sensei_installed' ); |
|
| 18 | 16 | \ No newline at end of file |
| 17 | +delete_option('skip_install_sensei_pages'); |
|
| 18 | +delete_option('sensei_installed'); |
|
| 19 | 19 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. |
|
| 2 | +if ( ! defined('ABSPATH')) exit; // Exit if accessed directly.
|
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Sensei Course Categories Widget |
@@ -26,18 +26,18 @@ discard block |
||
| 26 | 26 | public function __construct() {
|
| 27 | 27 | /* Widget variable settings. */ |
| 28 | 28 | $this->woo_widget_cssclass = 'widget_sensei_course_categories'; |
| 29 | - $this->woo_widget_description = __( 'This widget will output a list of Course Categories.', 'woothemes-sensei' ); |
|
| 29 | + $this->woo_widget_description = __('This widget will output a list of Course Categories.', 'woothemes-sensei');
|
|
| 30 | 30 | $this->woo_widget_idbase = 'sensei_course_categories'; |
| 31 | - $this->woo_widget_title = __( 'Sensei - Course Categories', 'woothemes-sensei' ); |
|
| 31 | + $this->woo_widget_title = __('Sensei - Course Categories', 'woothemes-sensei');
|
|
| 32 | 32 | |
| 33 | 33 | /* Widget settings. */ |
| 34 | - $widget_ops = array( 'classname' => $this->woo_widget_cssclass, 'description' => $this->woo_widget_description ); |
|
| 34 | + $widget_ops = array('classname' => $this->woo_widget_cssclass, 'description' => $this->woo_widget_description);
|
|
| 35 | 35 | |
| 36 | 36 | /* Widget control settings. */ |
| 37 | - $control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => $this->woo_widget_idbase ); |
|
| 37 | + $control_ops = array('width' => 250, 'height' => 350, 'id_base' => $this->woo_widget_idbase);
|
|
| 38 | 38 | |
| 39 | 39 | /* Create the widget. */ |
| 40 | - parent::__construct( $this->woo_widget_idbase, $this->woo_widget_title, $widget_ops, $control_ops ); |
|
| 40 | + parent::__construct($this->woo_widget_idbase, $this->woo_widget_title, $widget_ops, $control_ops); |
|
| 41 | 41 | } // End __construct() |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -47,26 +47,26 @@ discard block |
||
| 47 | 47 | * @param array $instance Widget settings for this instance. |
| 48 | 48 | * @return void |
| 49 | 49 | */ |
| 50 | - public function widget( $args, $instance ) {
|
|
| 51 | - extract( $args, EXTR_SKIP ); |
|
| 50 | + public function widget($args, $instance) {
|
|
| 51 | + extract($args, EXTR_SKIP); |
|
| 52 | 52 | |
| 53 | 53 | /* Our variables from the widget settings. */ |
| 54 | - $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base );
|
|
| 54 | + $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
|
|
| 55 | 55 | |
| 56 | 56 | /* Before widget (defined by themes). */ |
| 57 | 57 | echo $before_widget; |
| 58 | 58 | |
| 59 | 59 | /* Display the widget title if one was input (before and after defined by themes). */ |
| 60 | - if ( $title ) { echo $before_title . $title . $after_title; }
|
|
| 60 | + if ($title) { echo $before_title.$title.$after_title; }
|
|
| 61 | 61 | |
| 62 | 62 | /* Widget content. */ |
| 63 | 63 | // Add actions for plugins/themes to hook onto. |
| 64 | - do_action( $this->woo_widget_cssclass . '_top' ); |
|
| 64 | + do_action($this->woo_widget_cssclass.'_top'); |
|
| 65 | 65 | |
| 66 | - $this->load_component( $instance ); |
|
| 66 | + $this->load_component($instance); |
|
| 67 | 67 | |
| 68 | 68 | // Add actions for plugins/themes to hook onto. |
| 69 | - do_action( $this->woo_widget_cssclass . '_bottom' ); |
|
| 69 | + do_action($this->woo_widget_cssclass.'_bottom'); |
|
| 70 | 70 | |
| 71 | 71 | /* After widget (defined by themes). */ |
| 72 | 72 | echo $after_widget; |
@@ -80,14 +80,14 @@ discard block |
||
| 80 | 80 | * @param array $old_instance Previous settings. |
| 81 | 81 | * @return array Updated settings. |
| 82 | 82 | */ |
| 83 | - public function update ( $new_instance, $old_instance ) {
|
|
| 83 | + public function update($new_instance, $old_instance) {
|
|
| 84 | 84 | $instance = $old_instance; |
| 85 | 85 | |
| 86 | 86 | /* Strip tags for title and name to remove HTML (important for text inputs). */ |
| 87 | - $instance['title'] = strip_tags( $new_instance['title'] ); |
|
| 87 | + $instance['title'] = strip_tags($new_instance['title']); |
|
| 88 | 88 | |
| 89 | 89 | /* The select box is returning a text value, so we escape it. */ |
| 90 | - $instance['limit'] = esc_attr( $new_instance['limit'] ); |
|
| 90 | + $instance['limit'] = esc_attr($new_instance['limit']); |
|
| 91 | 91 | |
| 92 | 92 | /* The check box is returning a boolean value. */ |
| 93 | 93 | $instance['count'] = $new_instance['count']; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | * @param array $instance The settings for this instance. |
| 104 | 104 | * @return void |
| 105 | 105 | */ |
| 106 | - public function form( $instance ) {
|
|
| 106 | + public function form($instance) {
|
|
| 107 | 107 | |
| 108 | 108 | /* Set up some default widget settings. */ |
| 109 | 109 | /* Make sure all keys are added here, even with empty string values. */ |
@@ -114,27 +114,27 @@ discard block |
||
| 114 | 114 | 'hierarchical' => false |
| 115 | 115 | ); |
| 116 | 116 | |
| 117 | - $instance = wp_parse_args( (array) $instance, $defaults ); |
|
| 117 | + $instance = wp_parse_args((array) $instance, $defaults); |
|
| 118 | 118 | ?> |
| 119 | 119 | <!-- Widget Title: Text Input --> |
| 120 | 120 | <p> |
| 121 | - <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title (optional):', 'woothemes-sensei' ); ?></label> |
|
| 122 | - <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" /> |
|
| 121 | + <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php _e('Title (optional):', 'woothemes-sensei'); ?></label>
|
|
| 122 | + <input type="text" name="<?php echo esc_attr($this->get_field_name('title')); ?>" value="<?php echo esc_attr($instance['title']); ?>" class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" />
|
|
| 123 | 123 | </p> |
| 124 | 124 | <!-- Widget Limit: Text Input --> |
| 125 | 125 | <p> |
| 126 | - <label for="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>"><?php _e( 'Number of Categories (optional):', 'woothemes-sensei' ); ?></label> |
|
| 127 | - <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'limit' ) ); ?>" value="<?php echo esc_attr( $instance['limit'] ); ?>" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>" /> |
|
| 126 | + <label for="<?php echo esc_attr($this->get_field_id('limit')); ?>"><?php _e('Number of Categories (optional):', 'woothemes-sensei'); ?></label>
|
|
| 127 | + <input type="text" name="<?php echo esc_attr($this->get_field_name('limit')); ?>" value="<?php echo esc_attr($instance['limit']); ?>" class="widefat" id="<?php echo esc_attr($this->get_field_id('limit')); ?>" />
|
|
| 128 | 128 | </p> |
| 129 | 129 | <!-- Widget Show Count: Checkbox Input --> |
| 130 | 130 | <p> |
| 131 | - <input type="checkbox" class="checkbox" id="<?php echo esc_attr( $this->get_field_id('count') ); ?>" name="<?php echo esc_attr( $this->get_field_name('count') ); ?>"<?php checked( $instance['count'], 'on' ); ?> />
|
|
| 132 | - <label for="<?php echo esc_attr( $this->get_field_id('count') ); ?>"><?php _e( 'Show post counts', 'woothemes-sensei' ); ?></label><br />
|
|
| 131 | + <input type="checkbox" class="checkbox" id="<?php echo esc_attr($this->get_field_id('count')); ?>" name="<?php echo esc_attr($this->get_field_name('count')); ?>"<?php checked($instance['count'], 'on'); ?> />
|
|
| 132 | + <label for="<?php echo esc_attr($this->get_field_id('count')); ?>"><?php _e('Show post counts', 'woothemes-sensei'); ?></label><br />
|
|
| 133 | 133 | </p> |
| 134 | 134 | <!-- Widget Show Hierarchy: Checkbox Input --> |
| 135 | 135 | <p> |
| 136 | - <input type="checkbox" class="checkbox" id="<?php echo esc_attr( $this->get_field_id('hierarchical') ); ?>" name="<?php echo esc_attr( $this->get_field_name('hierarchical') ); ?>"<?php checked( $instance['hierarchical'], 'on' ); ?> />
|
|
| 137 | - <label for="<?php echo esc_attr( $this->get_field_id('hierarchical') ); ?>"><?php _e( 'Show hierarchy', 'woothemes-sensei' ); ?></label></p>
|
|
| 136 | + <input type="checkbox" class="checkbox" id="<?php echo esc_attr($this->get_field_id('hierarchical')); ?>" name="<?php echo esc_attr($this->get_field_name('hierarchical')); ?>"<?php checked($instance['hierarchical'], 'on'); ?> />
|
|
| 137 | + <label for="<?php echo esc_attr($this->get_field_id('hierarchical')); ?>"><?php _e('Show hierarchy', 'woothemes-sensei'); ?></label></p>
|
|
| 138 | 138 | </p> |
| 139 | 139 | <?php |
| 140 | 140 | } // End form() |
@@ -145,18 +145,18 @@ discard block |
||
| 145 | 145 | * @since 1.1.0 |
| 146 | 146 | * @return void |
| 147 | 147 | */ |
| 148 | - protected function load_component ( $instance ) {
|
|
| 148 | + protected function load_component($instance) {
|
|
| 149 | 149 | |
| 150 | - $limit = intval( $instance['limit'] ); |
|
| 151 | - $count = isset($instance['count']) ? (bool) $instance['count'] :false; |
|
| 152 | - $hierarchical = isset( $instance['hierarchical'] ) ? (bool) $instance['hierarchical'] : false; |
|
| 150 | + $limit = intval($instance['limit']); |
|
| 151 | + $count = isset($instance['count']) ? (bool) $instance['count'] : false; |
|
| 152 | + $hierarchical = isset($instance['hierarchical']) ? (bool) $instance['hierarchical'] : false; |
|
| 153 | 153 | |
| 154 | - $cat_args = array( 'title_li' => '', 'taxonomy' => 'course-category', 'orderby' => 'name', 'show_count' => $count, 'hierarchical' => $hierarchical); |
|
| 155 | - if ( 0 < $limit ) {
|
|
| 156 | - $cat_args[ 'number' ] = $limit; |
|
| 154 | + $cat_args = array('title_li' => '', 'taxonomy' => 'course-category', 'orderby' => 'name', 'show_count' => $count, 'hierarchical' => $hierarchical);
|
|
| 155 | + if (0 < $limit) {
|
|
| 156 | + $cat_args['number'] = $limit; |
|
| 157 | 157 | } // End If Statement |
| 158 | 158 | echo '<ul>'; |
| 159 | - wp_list_categories( apply_filters('widget_course_categories_args', $cat_args) );
|
|
| 159 | + wp_list_categories(apply_filters('widget_course_categories_args', $cat_args));
|
|
| 160 | 160 | echo '</ul>'; |
| 161 | 161 | } // End load_component() |
| 162 | 162 | } // End Class |
| 163 | 163 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. |
|
| 2 | +if ( ! defined('ABSPATH')) exit; // Exit if accessed directly.
|
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Sensei Lesson Component Widget |
@@ -26,22 +26,22 @@ discard block |
||
| 26 | 26 | public function __construct() {
|
| 27 | 27 | /* Widget variable settings. */ |
| 28 | 28 | $this->woo_widget_cssclass = 'widget_sensei_lesson_component'; |
| 29 | - $this->woo_widget_description = __( 'This widget will output a list of the latest Lessons.', 'woothemes-sensei' ); |
|
| 29 | + $this->woo_widget_description = __('This widget will output a list of the latest Lessons.', 'woothemes-sensei');
|
|
| 30 | 30 | $this->woo_widget_idbase = 'sensei_lesson_component'; |
| 31 | - $this->woo_widget_title = __( 'Sensei - Lesson Component', 'woothemes-sensei' ); |
|
| 31 | + $this->woo_widget_title = __('Sensei - Lesson Component', 'woothemes-sensei');
|
|
| 32 | 32 | |
| 33 | 33 | $this->woo_widget_componentslist = array( |
| 34 | - 'newlessons' => __( 'New Lessons', 'woothemes-sensei' ), |
|
| 34 | + 'newlessons' => __('New Lessons', 'woothemes-sensei'),
|
|
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | 37 | /* Widget settings. */ |
| 38 | - $widget_ops = array( 'classname' => $this->woo_widget_cssclass, 'description' => $this->woo_widget_description ); |
|
| 38 | + $widget_ops = array('classname' => $this->woo_widget_cssclass, 'description' => $this->woo_widget_description);
|
|
| 39 | 39 | |
| 40 | 40 | /* Widget control settings. */ |
| 41 | - $control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => $this->woo_widget_idbase ); |
|
| 41 | + $control_ops = array('width' => 250, 'height' => 350, 'id_base' => $this->woo_widget_idbase);
|
|
| 42 | 42 | |
| 43 | 43 | /* Create the widget. */ |
| 44 | - parent::__construct( $this->woo_widget_idbase, $this->woo_widget_title, $widget_ops, $control_ops ); |
|
| 44 | + parent::__construct($this->woo_widget_idbase, $this->woo_widget_title, $widget_ops, $control_ops); |
|
| 45 | 45 | } // End __construct() |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -51,32 +51,32 @@ discard block |
||
| 51 | 51 | * @param array $instance Widget settings for this instance. |
| 52 | 52 | * @return void |
| 53 | 53 | */ |
| 54 | - public function widget( $args, $instance ) {
|
|
| 55 | - extract( $args, EXTR_SKIP ); |
|
| 54 | + public function widget($args, $instance) {
|
|
| 55 | + extract($args, EXTR_SKIP); |
|
| 56 | 56 | |
| 57 | 57 | |
| 58 | - if ( in_array( $instance['component'], array_keys( $this->woo_widget_componentslist ) ) && ( 'activecourses' == $instance['component'] || 'completedcourses' == $instance['component'] ) && !is_user_logged_in() ) {
|
|
| 58 | + if (in_array($instance['component'], array_keys($this->woo_widget_componentslist)) && ('activecourses' == $instance['component'] || 'completedcourses' == $instance['component']) && ! is_user_logged_in()) {
|
|
| 59 | 59 | // No Output |
| 60 | 60 | } else {
|
| 61 | 61 | /* Our variables from the widget settings. */ |
| 62 | - $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base );
|
|
| 62 | + $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
|
|
| 63 | 63 | |
| 64 | 64 | /* Before widget (defined by themes). */ |
| 65 | 65 | echo $before_widget; |
| 66 | 66 | |
| 67 | 67 | /* Display the widget title if one was input (before and after defined by themes). */ |
| 68 | - if ( $title ) { echo $before_title . $title . $after_title; }
|
|
| 68 | + if ($title) { echo $before_title.$title.$after_title; }
|
|
| 69 | 69 | |
| 70 | 70 | /* Widget content. */ |
| 71 | 71 | // Add actions for plugins/themes to hook onto. |
| 72 | - do_action( $this->woo_widget_cssclass . '_top' ); |
|
| 72 | + do_action($this->woo_widget_cssclass.'_top'); |
|
| 73 | 73 | |
| 74 | - if ( in_array( $instance['component'], array_keys( $this->woo_widget_componentslist ) ) ) {
|
|
| 75 | - $this->load_component( $instance ); |
|
| 74 | + if (in_array($instance['component'], array_keys($this->woo_widget_componentslist))) {
|
|
| 75 | + $this->load_component($instance); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | // Add actions for plugins/themes to hook onto. |
| 79 | - do_action( $this->woo_widget_cssclass . '_bottom' ); |
|
| 79 | + do_action($this->woo_widget_cssclass.'_bottom'); |
|
| 80 | 80 | |
| 81 | 81 | /* After widget (defined by themes). */ |
| 82 | 82 | echo $after_widget; |
@@ -91,17 +91,17 @@ discard block |
||
| 91 | 91 | * @param array $old_instance Previous settings. |
| 92 | 92 | * @return array Updated settings. |
| 93 | 93 | */ |
| 94 | - public function update ( $new_instance, $old_instance ) {
|
|
| 94 | + public function update($new_instance, $old_instance) {
|
|
| 95 | 95 | $instance = $old_instance; |
| 96 | 96 | |
| 97 | 97 | /* Strip tags for title and name to remove HTML (important for text inputs). */ |
| 98 | - $instance['title'] = strip_tags( $new_instance['title'] ); |
|
| 98 | + $instance['title'] = strip_tags($new_instance['title']); |
|
| 99 | 99 | |
| 100 | 100 | /* The select box is returning a text value, so we escape it. */ |
| 101 | - $instance['component'] = esc_attr( $new_instance['component'] ); |
|
| 101 | + $instance['component'] = esc_attr($new_instance['component']); |
|
| 102 | 102 | |
| 103 | 103 | /* The select box is returning a text value, so we escape it. */ |
| 104 | - $instance['limit'] = esc_attr( $new_instance['limit'] ); |
|
| 104 | + $instance['limit'] = esc_attr($new_instance['limit']); |
|
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | return $instance; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * @param array $instance The settings for this instance. |
| 115 | 115 | * @return void |
| 116 | 116 | */ |
| 117 | - public function form( $instance ) {
|
|
| 117 | + public function form($instance) {
|
|
| 118 | 118 | |
| 119 | 119 | /* Set up some default widget settings. */ |
| 120 | 120 | /* Make sure all keys are added here, even with empty string values. */ |
@@ -124,26 +124,26 @@ discard block |
||
| 124 | 124 | 'limit' => 3 |
| 125 | 125 | ); |
| 126 | 126 | |
| 127 | - $instance = wp_parse_args( (array) $instance, $defaults ); |
|
| 127 | + $instance = wp_parse_args((array) $instance, $defaults); |
|
| 128 | 128 | ?> |
| 129 | 129 | <!-- Widget Title: Text Input --> |
| 130 | 130 | <p> |
| 131 | - <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title (optional):', 'woothemes-sensei' ); ?></label> |
|
| 132 | - <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" /> |
|
| 131 | + <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php _e('Title (optional):', 'woothemes-sensei'); ?></label>
|
|
| 132 | + <input type="text" name="<?php echo esc_attr($this->get_field_name('title')); ?>" value="<?php echo esc_attr($instance['title']); ?>" class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" />
|
|
| 133 | 133 | </p> |
| 134 | 134 | <!-- Widget Component: Select Input --> |
| 135 | 135 | <p> |
| 136 | - <label for="<?php echo esc_attr( $this->get_field_id( 'component' ) ); ?>"><?php _e( 'Component:', 'woothemes-sensei' ); ?></label> |
|
| 137 | - <select name="<?php echo esc_attr( $this->get_field_name( 'component' ) ); ?>" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'component' ) ); ?>"> |
|
| 138 | - <?php foreach ( $this->woo_widget_componentslist as $k => $v ) { ?>
|
|
| 139 | - <option value="<?php echo esc_attr( $k ); ?>"<?php selected( $instance['component'], $k ); ?>><?php echo $v; ?></option> |
|
| 136 | + <label for="<?php echo esc_attr($this->get_field_id('component')); ?>"><?php _e('Component:', 'woothemes-sensei'); ?></label>
|
|
| 137 | + <select name="<?php echo esc_attr($this->get_field_name('component')); ?>" class="widefat" id="<?php echo esc_attr($this->get_field_id('component')); ?>">
|
|
| 138 | + <?php foreach ($this->woo_widget_componentslist as $k => $v) { ?>
|
|
| 139 | + <option value="<?php echo esc_attr($k); ?>"<?php selected($instance['component'], $k); ?>><?php echo $v; ?></option> |
|
| 140 | 140 | <?php } ?> |
| 141 | 141 | </select> |
| 142 | 142 | </p> |
| 143 | 143 | <!-- Widget Limit: Text Input --> |
| 144 | 144 | <p> |
| 145 | - <label for="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>"><?php _e( 'Number of Lessons (optional):', 'woothemes-sensei' ); ?></label> |
|
| 146 | - <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'limit' ) ); ?>" value="<?php echo esc_attr( $instance['limit'] ); ?>" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>" /> |
|
| 145 | + <label for="<?php echo esc_attr($this->get_field_id('limit')); ?>"><?php _e('Number of Lessons (optional):', 'woothemes-sensei'); ?></label>
|
|
| 146 | + <input type="text" name="<?php echo esc_attr($this->get_field_name('limit')); ?>" value="<?php echo esc_attr($instance['limit']); ?>" class="widefat" id="<?php echo esc_attr($this->get_field_id('limit')); ?>" />
|
|
| 147 | 147 | </p> |
| 148 | 148 | |
| 149 | 149 | <?php |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * @since 5.0.8 |
| 156 | 156 | * @return void |
| 157 | 157 | */ |
| 158 | - protected function load_component ( $instance ) {
|
|
| 158 | + protected function load_component($instance) {
|
|
| 159 | 159 | global $current_user; |
| 160 | 160 | // Get User Meta |
| 161 | 161 | get_currentuserinfo(); |
@@ -165,41 +165,41 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | $posts_array = array(); |
| 167 | 167 | |
| 168 | - $post_args = array( 'post_type' => 'lesson', |
|
| 169 | - 'posts_per_page' => intval( $instance[ 'limit' ] ), |
|
| 168 | + $post_args = array('post_type' => 'lesson',
|
|
| 169 | + 'posts_per_page' => intval($instance['limit']), |
|
| 170 | 170 | 'orderby' => 'menu_order date', |
| 171 | 171 | 'order' => 'DESC', |
| 172 | 172 | 'post_status' => 'publish', |
| 173 | 173 | 'suppress_filters' => 0 |
| 174 | 174 | ); |
| 175 | - $posts_array = get_posts( $post_args ); |
|
| 175 | + $posts_array = get_posts($post_args); |
|
| 176 | 176 | |
| 177 | - if ( count( $posts_array ) > 0 ) { ?>
|
|
| 177 | + if (count($posts_array) > 0) { ?>
|
|
| 178 | 178 | <ul> |
| 179 | - <?php foreach ($posts_array as $post_item){
|
|
| 180 | - $post_id = absint( $post_item->ID ); |
|
| 179 | + <?php foreach ($posts_array as $post_item) {
|
|
| 180 | + $post_id = absint($post_item->ID); |
|
| 181 | 181 | $post_title = $post_item->post_title; |
| 182 | - $user_info = get_userdata( absint( $post_item->post_author ) ); |
|
| 183 | - $author_link = get_author_posts_url( absint( $post_item->post_author ) ); |
|
| 182 | + $user_info = get_userdata(absint($post_item->post_author)); |
|
| 183 | + $author_link = get_author_posts_url(absint($post_item->post_author)); |
|
| 184 | 184 | $author_display_name = $user_info->display_name; |
| 185 | 185 | $author_id = $post_item->post_author; |
| 186 | - $lesson_course_id = get_post_meta( $post_id, '_lesson_course', true ); |
|
| 186 | + $lesson_course_id = get_post_meta($post_id, '_lesson_course', true); |
|
| 187 | 187 | ?> |
| 188 | 188 | <li class="fix"> |
| 189 | - <?php do_action( 'sensei_lesson_image', $post_id, '100', '100', false, true ); ?> |
|
| 190 | - <a href="<?php echo esc_url( get_permalink( $post_id ) ); ?>" title="<?php echo esc_attr( $post_title ); ?>"><?php echo $post_title; ?></a> |
|
| 189 | + <?php do_action('sensei_lesson_image', $post_id, '100', '100', false, true); ?>
|
|
| 190 | + <a href="<?php echo esc_url(get_permalink($post_id)); ?>" title="<?php echo esc_attr($post_title); ?>"><?php echo $post_title; ?></a> |
|
| 191 | 191 | <br /> |
| 192 | - <?php if ( isset( Sensei()->settings->settings[ 'lesson_author' ] ) && ( Sensei()->settings->settings[ 'lesson_author' ] ) ) { ?>
|
|
| 193 | - <span class="course-author"><?php _e( 'by ', 'woothemes-sensei' ); ?><a href="<?php echo esc_url( $author_link ); ?>" title="<?php echo esc_attr( $author_display_name ); ?>"><?php echo esc_html( $author_display_name ); ?></a></span> |
|
| 192 | + <?php if (isset(Sensei()->settings->settings['lesson_author']) && (Sensei()->settings->settings['lesson_author'])) { ?>
|
|
| 193 | + <span class="course-author"><?php _e('by ', 'woothemes-sensei'); ?><a href="<?php echo esc_url($author_link); ?>" title="<?php echo esc_attr($author_display_name); ?>"><?php echo esc_html($author_display_name); ?></a></span>
|
|
| 194 | 194 | <br /> |
| 195 | 195 | <?php } // End If Statement ?> |
| 196 | - <?php if ( 0 < $lesson_course_id ) { ?>
|
|
| 197 | - <span class="lesson-course"><?php echo ' ' . sprintf( __( 'Part of: %s', 'woothemes-sensei' ), '<a href="' . esc_url( get_permalink( $lesson_course_id ) ) . '" title="' . esc_attr( __( 'View course', 'woothemes-sensei' ) ) . '"><em>' . get_the_title( $lesson_course_id ) . '</em></a>' ); ?></span> |
|
| 196 | + <?php if (0 < $lesson_course_id) { ?>
|
|
| 197 | + <span class="lesson-course"><?php echo ' '.sprintf(__('Part of: %s', 'woothemes-sensei'), '<a href="'.esc_url(get_permalink($lesson_course_id)).'" title="'.esc_attr(__('View course', 'woothemes-sensei')).'"><em>'.get_the_title($lesson_course_id).'</em></a>'); ?></span>
|
|
| 198 | 198 | <?php } ?> |
| 199 | 199 | <br /> |
| 200 | 200 | </li> |
| 201 | 201 | <?php } // End For Loop ?> |
| 202 | - <?php echo '<li class="my-account fix"><a class="button" href="'. esc_url( get_post_type_archive_link( 'lesson' ) ) .'">'.__('More Lessons', 'woothemes-sensei').'</a></li>'; ?>
|
|
| 202 | + <?php echo '<li class="my-account fix"><a class="button" href="'.esc_url(get_post_type_archive_link('lesson')).'">'.__('More Lessons', 'woothemes-sensei').'</a></li>'; ?>
|
|
| 203 | 203 | </ul> |
| 204 | 204 | <?php } // End If Statement |
| 205 | 205 | } // End load_component() |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. |
|
| 2 | +if ( ! defined('ABSPATH')) exit; // Exit if accessed directly.
|
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Sensei Category Courses Widget |
@@ -26,18 +26,18 @@ discard block |
||
| 26 | 26 | public function __construct() {
|
| 27 | 27 | /* Widget variable settings. */ |
| 28 | 28 | $this->woo_widget_cssclass = 'widget_sensei_category_courses'; |
| 29 | - $this->woo_widget_description = __( 'This widget will output a list of Courses for a specific category.', 'woothemes-sensei' ); |
|
| 29 | + $this->woo_widget_description = __('This widget will output a list of Courses for a specific category.', 'woothemes-sensei');
|
|
| 30 | 30 | $this->woo_widget_idbase = 'sensei_category_courses'; |
| 31 | - $this->woo_widget_title = __( 'Sensei - Category Courses', 'woothemes-sensei' ); |
|
| 31 | + $this->woo_widget_title = __('Sensei - Category Courses', 'woothemes-sensei');
|
|
| 32 | 32 | |
| 33 | 33 | /* Widget settings. */ |
| 34 | - $widget_ops = array( 'classname' => $this->woo_widget_cssclass, 'description' => $this->woo_widget_description ); |
|
| 34 | + $widget_ops = array('classname' => $this->woo_widget_cssclass, 'description' => $this->woo_widget_description);
|
|
| 35 | 35 | |
| 36 | 36 | /* Widget control settings. */ |
| 37 | - $control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => $this->woo_widget_idbase ); |
|
| 37 | + $control_ops = array('width' => 250, 'height' => 350, 'id_base' => $this->woo_widget_idbase);
|
|
| 38 | 38 | |
| 39 | 39 | /* Create the widget. */ |
| 40 | - parent::__construct( $this->woo_widget_idbase, $this->woo_widget_title, $widget_ops, $control_ops ); |
|
| 40 | + parent::__construct($this->woo_widget_idbase, $this->woo_widget_title, $widget_ops, $control_ops); |
|
| 41 | 41 | |
| 42 | 42 | } // End __construct() |
| 43 | 43 | |
@@ -48,28 +48,28 @@ discard block |
||
| 48 | 48 | * @param array $instance Widget settings for this instance. |
| 49 | 49 | * @return void |
| 50 | 50 | */ |
| 51 | - public function widget( $args, $instance ) {
|
|
| 52 | - extract( $args, EXTR_SKIP ); |
|
| 51 | + public function widget($args, $instance) {
|
|
| 52 | + extract($args, EXTR_SKIP); |
|
| 53 | 53 | |
| 54 | 54 | /* Our variables from the widget settings. */ |
| 55 | - $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base );
|
|
| 55 | + $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
|
|
| 56 | 56 | |
| 57 | 57 | /* Before widget (defined by themes). */ |
| 58 | 58 | echo $before_widget; |
| 59 | 59 | |
| 60 | 60 | /* Display the widget title if one was input (before and after defined by themes). */ |
| 61 | - if ( $title ) { echo $before_title . $title . $after_title; }
|
|
| 61 | + if ($title) { echo $before_title.$title.$after_title; }
|
|
| 62 | 62 | |
| 63 | 63 | /* Widget content. */ |
| 64 | 64 | // Add actions for plugins/themes to hook onto. |
| 65 | - do_action( $this->woo_widget_cssclass . '_top' ); |
|
| 65 | + do_action($this->woo_widget_cssclass.'_top'); |
|
| 66 | 66 | |
| 67 | - if ( 0 < intval( $instance['course_category'] ) ) {
|
|
| 68 | - $this->load_component( $instance ); |
|
| 67 | + if (0 < intval($instance['course_category'])) {
|
|
| 68 | + $this->load_component($instance); |
|
| 69 | 69 | } // End If Statement |
| 70 | 70 | |
| 71 | 71 | // Add actions for plugins/themes to hook onto. |
| 72 | - do_action( $this->woo_widget_cssclass . '_bottom' ); |
|
| 72 | + do_action($this->woo_widget_cssclass.'_bottom'); |
|
| 73 | 73 | |
| 74 | 74 | /* After widget (defined by themes). */ |
| 75 | 75 | echo $after_widget; |
@@ -83,17 +83,17 @@ discard block |
||
| 83 | 83 | * @param array $old_instance Previous settings. |
| 84 | 84 | * @return array Updated settings. |
| 85 | 85 | */ |
| 86 | - public function update ( $new_instance, $old_instance ) {
|
|
| 86 | + public function update($new_instance, $old_instance) {
|
|
| 87 | 87 | $instance = $old_instance; |
| 88 | 88 | |
| 89 | 89 | /* Strip tags for title and name to remove HTML (important for text inputs). */ |
| 90 | - $instance['title'] = strip_tags( $new_instance['title'] ); |
|
| 90 | + $instance['title'] = strip_tags($new_instance['title']); |
|
| 91 | 91 | |
| 92 | 92 | /* The select box is returning a text value, so we escape it. */ |
| 93 | - $instance['course_category'] = esc_attr( $new_instance['course_category'] ); |
|
| 93 | + $instance['course_category'] = esc_attr($new_instance['course_category']); |
|
| 94 | 94 | |
| 95 | 95 | /* Strip tags for limit to remove HTML (important for text inputs). */ |
| 96 | - $instance['limit'] = strip_tags( $new_instance['limit'] ); |
|
| 96 | + $instance['limit'] = strip_tags($new_instance['limit']); |
|
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | return $instance; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * @param array $instance The settings for this instance. |
| 107 | 107 | * @return void |
| 108 | 108 | */ |
| 109 | - public function form( $instance ) {
|
|
| 109 | + public function form($instance) {
|
|
| 110 | 110 | |
| 111 | 111 | /* Set up some default widget settings. */ |
| 112 | 112 | /* Make sure all keys are added here, even with empty string values. */ |
@@ -116,25 +116,25 @@ discard block |
||
| 116 | 116 | 'limit' => 3 |
| 117 | 117 | ); |
| 118 | 118 | |
| 119 | - $instance = wp_parse_args( (array) $instance, $defaults ); |
|
| 119 | + $instance = wp_parse_args((array) $instance, $defaults); |
|
| 120 | 120 | ?> |
| 121 | 121 | <!-- Widget Title: Text Input --> |
| 122 | 122 | <p> |
| 123 | - <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title (optional):', 'woothemes-sensei' ); ?></label> |
|
| 124 | - <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" /> |
|
| 123 | + <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php _e('Title (optional):', 'woothemes-sensei'); ?></label>
|
|
| 124 | + <input type="text" name="<?php echo esc_attr($this->get_field_name('title')); ?>" value="<?php echo esc_attr($instance['title']); ?>" class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" />
|
|
| 125 | 125 | </p> |
| 126 | 126 | <!-- Widget Course Category: Select Input --> |
| 127 | 127 | <p> |
| 128 | - <label for="<?php echo esc_attr( $this->get_field_id( 'course_category' ) ); ?>"><?php _e( 'Course Category:', 'woothemes-sensei' ); ?></label> |
|
| 128 | + <label for="<?php echo esc_attr($this->get_field_id('course_category')); ?>"><?php _e('Course Category:', 'woothemes-sensei'); ?></label>
|
|
| 129 | 129 | <?php |
| 130 | - $cat_args = array( 'hierarchical' => true, 'show_option_none' => __( 'Select Category:', 'woothemes-sensei' ), 'taxonomy' => 'course-category', 'orderby' => 'name', 'selected' => intval( $instance['course_category'] ), 'id' => $this->get_field_id( 'course_category' ), 'name' => $this->get_field_name( 'course_category' ), 'class' => 'widefat' ); |
|
| 130 | + $cat_args = array('hierarchical' => true, 'show_option_none' => __('Select Category:', 'woothemes-sensei'), 'taxonomy' => 'course-category', 'orderby' => 'name', 'selected' => intval($instance['course_category']), 'id' => $this->get_field_id('course_category'), 'name' => $this->get_field_name('course_category'), 'class' => 'widefat');
|
|
| 131 | 131 | wp_dropdown_categories(apply_filters('widget_course_categories_dropdown_args', $cat_args));
|
| 132 | 132 | ?> |
| 133 | 133 | </p> |
| 134 | 134 | <!-- Widget Limit: Text Input --> |
| 135 | 135 | <p> |
| 136 | - <label for="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>"><?php _e( 'Number of Courses (optional):', 'woothemes-sensei' ); ?></label> |
|
| 137 | - <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'limit' ) ); ?>" value="<?php echo esc_attr( $instance['limit'] ); ?>" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>" /> |
|
| 136 | + <label for="<?php echo esc_attr($this->get_field_id('limit')); ?>"><?php _e('Number of Courses (optional):', 'woothemes-sensei'); ?></label>
|
|
| 137 | + <input type="text" name="<?php echo esc_attr($this->get_field_name('limit')); ?>" value="<?php echo esc_attr($instance['limit']); ?>" class="widefat" id="<?php echo esc_attr($this->get_field_id('limit')); ?>" />
|
|
| 138 | 138 | </p> |
| 139 | 139 | |
| 140 | 140 | <?php |
@@ -146,49 +146,49 @@ discard block |
||
| 146 | 146 | * @since 1.1.0 |
| 147 | 147 | * @return void |
| 148 | 148 | */ |
| 149 | - protected function load_component ( $instance ) {
|
|
| 149 | + protected function load_component($instance) {
|
|
| 150 | 150 | |
| 151 | 151 | |
| 152 | 152 | $posts_array = array(); |
| 153 | - $post_args = array( 'post_type' => 'course', |
|
| 154 | - 'posts_per_page' => intval( $instance[ 'limit' ] ), |
|
| 153 | + $post_args = array('post_type' => 'course',
|
|
| 154 | + 'posts_per_page' => intval($instance['limit']), |
|
| 155 | 155 | 'orderby' => 'menu_order date', |
| 156 | 156 | 'order' => 'ASC', |
| 157 | 157 | 'post_status' => 'publish', |
| 158 | 158 | 'suppress_filters' => 0, |
| 159 | 159 | ); |
| 160 | 160 | |
| 161 | - $post_args[ 'tax_query' ] = array( |
|
| 161 | + $post_args['tax_query'] = array( |
|
| 162 | 162 | array( |
| 163 | 163 | 'taxonomy' => 'course-category', |
| 164 | 164 | 'field' => 'id', |
| 165 | - 'terms' => intval( $instance['course_category'] ) |
|
| 165 | + 'terms' => intval($instance['course_category']) |
|
| 166 | 166 | ) |
| 167 | 167 | ); |
| 168 | 168 | |
| 169 | - $posts_array = get_posts( $post_args ); |
|
| 169 | + $posts_array = get_posts($post_args); |
|
| 170 | 170 | |
| 171 | - if ( count( $posts_array ) > 0 ) { ?>
|
|
| 171 | + if (count($posts_array) > 0) { ?>
|
|
| 172 | 172 | <ul> |
| 173 | - <?php foreach ($posts_array as $post_item){
|
|
| 174 | - $post_id = absint( $post_item->ID ); |
|
| 173 | + <?php foreach ($posts_array as $post_item) {
|
|
| 174 | + $post_id = absint($post_item->ID); |
|
| 175 | 175 | $post_title = $post_item->post_title; |
| 176 | - $user_info = get_userdata( absint( $post_item->post_author ) ); |
|
| 177 | - $author_link = get_author_posts_url( absint( $post_item->post_author ) ); |
|
| 176 | + $user_info = get_userdata(absint($post_item->post_author)); |
|
| 177 | + $author_link = get_author_posts_url(absint($post_item->post_author)); |
|
| 178 | 178 | $author_display_name = $user_info->display_name; |
| 179 | 179 | $author_id = $post_item->post_author; |
| 180 | 180 | ?> |
| 181 | 181 | <li class="fix"> |
| 182 | - <?php do_action( 'sensei_course_image', $post_id ); ?> |
|
| 183 | - <a href="<?php echo esc_url( get_permalink( $post_id ) ); ?>" title="<?php echo esc_attr( $post_title ); ?>"><?php echo $post_title; ?></a> |
|
| 182 | + <?php do_action('sensei_course_image', $post_id); ?>
|
|
| 183 | + <a href="<?php echo esc_url(get_permalink($post_id)); ?>" title="<?php echo esc_attr($post_title); ?>"><?php echo $post_title; ?></a> |
|
| 184 | 184 | <br /> |
| 185 | - <?php if ( isset( Sensei()->settings->settings[ 'course_author' ] ) && ( Sensei()->settings->settings[ 'course_author' ] ) ) { ?>
|
|
| 186 | - <span class="course-author"><?php _e( 'by ', 'woothemes-sensei' ); ?><a href="<?php echo esc_url( $author_link ); ?>" title="<?php echo esc_attr( $author_display_name ); ?>"><?php echo esc_html( $author_display_name ); ?></a></span> |
|
| 185 | + <?php if (isset(Sensei()->settings->settings['course_author']) && (Sensei()->settings->settings['course_author'])) { ?>
|
|
| 186 | + <span class="course-author"><?php _e('by ', 'woothemes-sensei'); ?><a href="<?php echo esc_url($author_link); ?>" title="<?php echo esc_attr($author_display_name); ?>"><?php echo esc_html($author_display_name); ?></a></span>
|
|
| 187 | 187 | <br /> |
| 188 | 188 | <?php } // End If Statement ?> |
| 189 | - <span class="course-lesson-count"><?php echo Sensei()->course->course_lesson_count( $post_id ) . ' ' . __( 'Lessons', 'woothemes-sensei' ); ?></span> |
|
| 189 | + <span class="course-lesson-count"><?php echo Sensei()->course->course_lesson_count($post_id).' '.__('Lessons', 'woothemes-sensei'); ?></span>
|
|
| 190 | 190 | <br /> |
| 191 | - <?php sensei_simple_course_price( $post_id ); ?> |
|
| 191 | + <?php sensei_simple_course_price($post_id); ?> |
|
| 192 | 192 | </li> |
| 193 | 193 | <?php } // End For Loop ?> |
| 194 | 194 | </ul> |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 2 | +if ( ! defined('ABSPATH')) exit; |
|
| 3 | 3 | /** |
| 4 | 4 | * Content-lesson.php template file |
| 5 | 5 | * |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | ?> |
| 16 | 16 | |
| 17 | -<article <?php post_class( get_the_ID() ); ?> > |
|
| 17 | +<article <?php post_class(get_the_ID()); ?> > |
|
| 18 | 18 | |
| 19 | 19 | <section class="lesson-content"> |
| 20 | 20 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @since 1.9.0 |
| 28 | 28 | * @param string $post_id |
| 29 | 29 | */ |
| 30 | - do_action( 'sensei_content_lesson_before', get_the_ID() ); |
|
| 30 | + do_action('sensei_content_lesson_before', get_the_ID()); |
|
| 31 | 31 | ?> |
| 32 | 32 | |
| 33 | 33 | <section class="entry"> |
@@ -73,9 +73,9 @@ discard block |
||
| 73 | 73 | * @since 1.9.0 |
| 74 | 74 | * @param string $post_id |
| 75 | 75 | */ |
| 76 | - do_action( 'sensei_content_lesson_after', get_the_ID() ); |
|
| 76 | + do_action('sensei_content_lesson_after', get_the_ID()); |
|
| 77 | 77 | ?> |
| 78 | 78 | |
| 79 | 79 | </section> <!-- article .lesson-content --> |
| 80 | 80 | |
| 81 | -</article> <!-- article .(<?php esc_attr_e( join( ' ', get_post_class( array( 'lesson', 'post' ) ) ) ); ?> --> |
|
| 82 | 81 | \ No newline at end of file |
| 82 | +</article> <!-- article .(<?php esc_attr_e(join(' ', get_post_class(array('lesson', 'post')))); ?> --> |
|
| 83 | 83 | \ No newline at end of file |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | ?> |
| 13 | 13 | |
| 14 | -<?php get_sensei_header(); ?> |
|
| 14 | +<?php get_sensei_header(); ?> |
|
| 15 | 15 | |
| 16 | 16 | <article <?php post_class(); ?>> |
| 17 | 17 | |
@@ -27,15 +27,15 @@ discard block |
||
| 27 | 27 | * @param $quiz_id |
| 28 | 28 | * |
| 29 | 29 | */ |
| 30 | - do_action( 'sensei_single_quiz_content_inside_before', get_the_ID() ); |
|
| 30 | + do_action('sensei_single_quiz_content_inside_before', get_the_ID()); |
|
| 31 | 31 | |
| 32 | 32 | ?> |
| 33 | 33 | |
| 34 | 34 | <section class="entry quiz-questions"> |
| 35 | 35 | |
| 36 | - <?php if ( sensei_quiz_has_questions() ): ?> |
|
| 36 | + <?php if (sensei_quiz_has_questions()): ?> |
|
| 37 | 37 | |
| 38 | - <form method="POST" action="<?php echo esc_url_raw( get_permalink() ); ?>" enctype="multipart/form-data"> |
|
| 38 | + <form method="POST" action="<?php echo esc_url_raw(get_permalink()); ?>" enctype="multipart/form-data"> |
|
| 39 | 39 | |
| 40 | 40 | <?php |
| 41 | 41 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * @param string $the_quiz_id |
| 48 | 48 | */ |
| 49 | - do_action( 'sensei_single_quiz_questions_before', get_the_id() ); |
|
| 49 | + do_action('sensei_single_quiz_questions_before', get_the_id()); |
|
| 50 | 50 | |
| 51 | 51 | ?> |
| 52 | 52 | |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | <ol id="sensei-quiz-list"> |
| 56 | 56 | |
| 57 | - <?php while ( sensei_quiz_has_questions() ): sensei_setup_the_question(); ?> |
|
| 57 | + <?php while (sensei_quiz_has_questions()): sensei_setup_the_question(); ?> |
|
| 58 | 58 | |
| 59 | - <li class="<?php sensei_the_question_class();?>"> |
|
| 59 | + <li class="<?php sensei_the_question_class(); ?>"> |
|
| 60 | 60 | |
| 61 | 61 | <?php |
| 62 | 62 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * @since 1.9.0 |
| 72 | 72 | * @param string $the_question_id |
| 73 | 73 | */ |
| 74 | - do_action( 'sensei_quiz_question_inside_before', sensei_get_the_question_id() ); |
|
| 74 | + do_action('sensei_quiz_question_inside_before', sensei_get_the_question_id()); |
|
| 75 | 75 | |
| 76 | 76 | ?> |
| 77 | 77 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * |
| 87 | 87 | * @param string $the_question_id |
| 88 | 88 | */ |
| 89 | - do_action( 'sensei_quiz_question_inside_after', sensei_get_the_question_id() ); |
|
| 89 | + do_action('sensei_quiz_question_inside_after', sensei_get_the_question_id()); |
|
| 90 | 90 | |
| 91 | 91 | ?> |
| 92 | 92 | |
@@ -103,21 +103,21 @@ discard block |
||
| 103 | 103 | * |
| 104 | 104 | * @param string $the_quiz_id |
| 105 | 105 | */ |
| 106 | - do_action( 'sensei_single_quiz_questions_after', get_the_id() ); |
|
| 106 | + do_action('sensei_single_quiz_questions_after', get_the_id()); |
|
| 107 | 107 | |
| 108 | 108 | ?> |
| 109 | 109 | |
| 110 | 110 | </form> |
| 111 | 111 | <?php else: ?> |
| 112 | 112 | |
| 113 | - <div class="sensei-message alert"> <?php _e( 'There are no questions for this Quiz yet. Check back soon.', 'woothemes-sensei' ); ?></div> |
|
| 113 | + <div class="sensei-message alert"> <?php _e('There are no questions for this Quiz yet. Check back soon.', 'woothemes-sensei'); ?></div> |
|
| 114 | 114 | |
| 115 | 115 | <?php endif; // End If have questions ?> |
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | <?php |
| 119 | 119 | $quiz_lesson = Sensei()->quiz->data->quiz_lesson; |
| 120 | - do_action( 'sensei_quiz_back_link', $quiz_lesson ); |
|
| 120 | + do_action('sensei_quiz_back_link', $quiz_lesson); |
|
| 121 | 121 | ?> |
| 122 | 122 | |
| 123 | 123 | </section> |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | * @hooked |
| 133 | 133 | * |
| 134 | 134 | */ |
| 135 | - do_action( 'sensei_single_quiz_content_inside_after' ); |
|
| 135 | + do_action('sensei_single_quiz_content_inside_after'); |
|
| 136 | 136 | |
| 137 | 137 | ?> |
| 138 | 138 | |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | ?> |
| 14 | 14 | |
| 15 | -<?php get_sensei_header(); ?> |
|
| 15 | +<?php get_sensei_header(); ?> |
|
| 16 | 16 | |
| 17 | 17 | <?php |
| 18 | 18 | |
@@ -23,17 +23,17 @@ discard block |
||
| 23 | 23 | * @since 1.9.0 |
| 24 | 24 | * |
| 25 | 25 | */ |
| 26 | - do_action( 'sensei_teacher_archive_course_loop_before' ); |
|
| 26 | + do_action('sensei_teacher_archive_course_loop_before'); |
|
| 27 | 27 | |
| 28 | 28 | ?> |
| 29 | 29 | |
| 30 | - <?php if ( have_posts() ): ?> |
|
| 30 | + <?php if (have_posts()): ?> |
|
| 31 | 31 | |
| 32 | - <?php sensei_load_template( 'loop-course.php' ); ?> |
|
| 32 | + <?php sensei_load_template('loop-course.php'); ?> |
|
| 33 | 33 | |
| 34 | 34 | <?php else: ?> |
| 35 | 35 | |
| 36 | - <p><?php _e( 'There are no courses for this teacher.', 'woothemes-sensei' ); ?></p> |
|
| 36 | + <p><?php _e('There are no courses for this teacher.', 'woothemes-sensei'); ?></p> |
|
| 37 | 37 | |
| 38 | 38 | <?php endif; // End If Statement ?> |
| 39 | 39 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * |
| 46 | 46 | * @since 1.9.0 |
| 47 | 47 | */ |
| 48 | - do_action( 'sensei_teacher_archive_course_loop_after' ); |
|
| 48 | + do_action('sensei_teacher_archive_course_loop_after'); |
|
| 49 | 49 | |
| 50 | 50 | ?> |
| 51 | 51 | |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | ?> |
| 14 | 14 | |
| 15 | -<?php get_sensei_header(); ?> |
|
| 15 | +<?php get_sensei_header(); ?> |
|
| 16 | 16 | |
| 17 | 17 | <?php |
| 18 | 18 | |
@@ -21,17 +21,17 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * It will be executed even if there are no posts on the archive page. |
| 23 | 23 | */ |
| 24 | - do_action( 'sensei_archive_before_lesson_loop' ); |
|
| 24 | + do_action('sensei_archive_before_lesson_loop'); |
|
| 25 | 25 | |
| 26 | 26 | ?> |
| 27 | 27 | |
| 28 | - <?php if ( have_posts() ): ?> |
|
| 28 | + <?php if (have_posts()): ?> |
|
| 29 | 29 | |
| 30 | - <?php sensei_load_template( 'loop-lesson.php' ); ?> |
|
| 30 | + <?php sensei_load_template('loop-lesson.php'); ?> |
|
| 31 | 31 | |
| 32 | 32 | <?php else: ?> |
| 33 | 33 | |
| 34 | - <p><?php _e( 'No lessons found that match your selection.', 'woothemes-sensei' ); ?></p> |
|
| 34 | + <p><?php _e('No lessons found that match your selection.', 'woothemes-sensei'); ?></p> |
|
| 35 | 35 | |
| 36 | 36 | <?php endif; // End If Statement ?> |
| 37 | 37 | |
@@ -43,6 +43,6 @@ discard block |
||
| 43 | 43 | * |
| 44 | 44 | * @since 1.9.0 |
| 45 | 45 | */ |
| 46 | - do_action( 'sensei_archive_after_lesson_loop' ); |
|
| 46 | + do_action('sensei_archive_after_lesson_loop'); |
|
| 47 | 47 | ?> |
| 48 | 48 | <?php get_sensei_footer(); ?> |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 2 | +if ( ! defined('ABSPATH')) exit; |
|
| 3 | 3 | /** |
| 4 | 4 | * The Template for outputting Lesson Archive items |
| 5 | 5 | * |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * |
| 19 | 19 | * @since 1.9 |
| 20 | 20 | */ |
| 21 | -do_action( 'sensei_loop_lesson_before' ); |
|
| 21 | +do_action('sensei_loop_lesson_before'); |
|
| 22 | 22 | ?> |
| 23 | 23 | |
| 24 | 24 | <section class="lesson-container" > |
@@ -32,15 +32,15 @@ discard block |
||
| 32 | 32 | * @hooked Sensei()->lesson->lesson_tag_archive_description - 11 |
| 33 | 33 | * @hooked Sensei()->lesson->the_archive_header - 20 |
| 34 | 34 | */ |
| 35 | - do_action( 'sensei_loop_lesson_inside_before' ); |
|
| 35 | + do_action('sensei_loop_lesson_inside_before'); |
|
| 36 | 36 | ?> |
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | <?php |
| 40 | 40 | //Loop through all lessons |
| 41 | - while ( have_posts() ) { the_post(); |
|
| 41 | + while (have_posts()) { the_post(); |
|
| 42 | 42 | |
| 43 | - sensei_load_template_part( 'content', 'lesson' ); |
|
| 43 | + sensei_load_template_part('content', 'lesson'); |
|
| 44 | 44 | |
| 45 | 45 | } |
| 46 | 46 | ?> |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * |
| 52 | 52 | * @since 1.9.0 |
| 53 | 53 | */ |
| 54 | - do_action( 'sensei_loop_lesson_inside_after' ); |
|
| 54 | + do_action('sensei_loop_lesson_inside_after'); |
|
| 55 | 55 | ?> |
| 56 | 56 | |
| 57 | 57 | </section> |
@@ -62,4 +62,4 @@ discard block |
||
| 62 | 62 | * |
| 63 | 63 | * @since 1.9.0 |
| 64 | 64 | */ |
| 65 | -do_action( 'sensei_loop_lesson_after' ); |
|
| 65 | +do_action('sensei_loop_lesson_after'); |
|