@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // security check |
|
| 2 | +if ( ! defined('ABSPATH')) exit; // security check |
|
| 3 | 3 | /** |
| 4 | 4 | * Sensei Shortcode Loader Class |
| 5 | 5 | * |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | * @category Shortcodes |
| 14 | 14 | * @since 1.9.0 |
| 15 | 15 | */ |
| 16 | -class Sensei_Shortcode_Loader{ |
|
| 16 | +class Sensei_Shortcode_Loader { |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * @var array { |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * |
| 31 | 31 | * @since 1.9.0 |
| 32 | 32 | */ |
| 33 | - public function __construct(){ |
|
| 33 | + public function __construct() { |
|
| 34 | 34 | |
| 35 | 35 | // create a list of shortcodes and the class that handles them |
| 36 | 36 | $this->setup_shortcode_class_map(); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $this->initialize_shortcodes(); |
| 40 | 40 | |
| 41 | 41 | // add sensei body class for shortcodes |
| 42 | - add_filter( 'body_class', array( $this, 'possibly_add_body_class' )); |
|
| 42 | + add_filter('body_class', array($this, 'possibly_add_body_class')); |
|
| 43 | 43 | |
| 44 | 44 | // array( $this, 'add_body_class') |
| 45 | 45 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * NOTE: When adding a new shortcode here be sure to load your shortcodes class |
| 59 | 59 | * in class-sensei-autoloader class_file_map function |
| 60 | 60 | */ |
| 61 | - public function setup_shortcode_class_map(){ |
|
| 61 | + public function setup_shortcode_class_map() { |
|
| 62 | 62 | |
| 63 | 63 | $this->shortcode_classes = array( |
| 64 | 64 | 'sensei_featured_courses' => 'Sensei_Shortcode_Featured_Courses', |
@@ -83,10 +83,10 @@ discard block |
||
| 83 | 83 | * This function adds shortcodes to WP that links to other functionality. |
| 84 | 84 | * @since 1.9.0 |
| 85 | 85 | */ |
| 86 | - public function initialize_shortcodes(){ |
|
| 86 | + public function initialize_shortcodes() { |
|
| 87 | 87 | |
| 88 | 88 | // shortcodes should only respond to front end calls |
| 89 | - if( is_admin() || defined( 'DOING_AJAX' ) ){ |
|
| 89 | + if (is_admin() || defined('DOING_AJAX')) { |
|
| 90 | 90 | return; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -96,12 +96,12 @@ discard block |
||
| 96 | 96 | * |
| 97 | 97 | * With this method we only load shortcode classes when we need them. |
| 98 | 98 | */ |
| 99 | - foreach( $this->shortcode_classes as $shortcode => $class ){ |
|
| 99 | + foreach ($this->shortcode_classes as $shortcode => $class) { |
|
| 100 | 100 | |
| 101 | 101 | // all Sensei shortcodes are rendered by this loader class |
| 102 | 102 | // it acts as an interface between wp and the shortcodes registered |
| 103 | 103 | // above |
| 104 | - add_shortcode( $shortcode, array( $this,'render_shortcode' ) ); |
|
| 104 | + add_shortcode($shortcode, array($this, 'render_shortcode')); |
|
| 105 | 105 | |
| 106 | 106 | } |
| 107 | 107 | |
@@ -119,23 +119,23 @@ discard block |
||
| 119 | 119 | * |
| 120 | 120 | * @return string |
| 121 | 121 | */ |
| 122 | - public function render_shortcode( $attributes='', $content='', $code ){ |
|
| 122 | + public function render_shortcode($attributes = '', $content = '', $code) { |
|
| 123 | 123 | |
| 124 | 124 | // only respond if the shortcode that we've added shortcode |
| 125 | 125 | // classes for. |
| 126 | - if( ! isset( $this->shortcode_classes[ $code ] ) ){ |
|
| 126 | + if ( ! isset($this->shortcode_classes[$code])) { |
|
| 127 | 127 | return ''; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | // create an instances of the current requested shortcode |
| 131 | - $shortcode_handling_class = $this->shortcode_classes[ $code ]; |
|
| 132 | - $shortcode = new $shortcode_handling_class( $attributes, $content, $code ); |
|
| 131 | + $shortcode_handling_class = $this->shortcode_classes[$code]; |
|
| 132 | + $shortcode = new $shortcode_handling_class($attributes, $content, $code); |
|
| 133 | 133 | |
| 134 | 134 | // we expect the sensei class instantiated to implement the Sensei_Shortcode interface |
| 135 | - if( ! in_array( 'Sensei_Shortcode_Interface', class_implements( $shortcode) ) ){ |
|
| 135 | + if ( ! in_array('Sensei_Shortcode_Interface', class_implements($shortcode))) { |
|
| 136 | 136 | |
| 137 | 137 | $message = "The rendering class for your shortcode: $code, must implement the Sensei_Shortcode interface"; |
| 138 | - _doing_it_wrong('Sensei_Shortcode_Loader::render_shortcode',$message, '1.9.0' ); |
|
| 138 | + _doing_it_wrong('Sensei_Shortcode_Loader::render_shortcode', $message, '1.9.0'); |
|
| 139 | 139 | |
| 140 | 140 | } |
| 141 | 141 | |
@@ -154,18 +154,18 @@ discard block |
||
| 154 | 154 | * @param array $classes |
| 155 | 155 | * @return array |
| 156 | 156 | */ |
| 157 | - public function possibly_add_body_class ( $classes ) { |
|
| 157 | + public function possibly_add_body_class($classes) { |
|
| 158 | 158 | |
| 159 | 159 | global $post; |
| 160 | 160 | |
| 161 | 161 | $has_sensei_shortcode = false; |
| 162 | 162 | |
| 163 | - if ( is_a( $post, 'WP_Post' ) ) { |
|
| 163 | + if (is_a($post, 'WP_Post')) { |
|
| 164 | 164 | |
| 165 | 165 | // check all registered Sensei shortcodes (not legacy shortcodes) |
| 166 | - foreach ( $this->shortcode_classes as $shortcode => $class ){ |
|
| 166 | + foreach ($this->shortcode_classes as $shortcode => $class) { |
|
| 167 | 167 | |
| 168 | - if ( has_shortcode( $post->post_content, $shortcode ) ) { |
|
| 168 | + if (has_shortcode($post->post_content, $shortcode)) { |
|
| 169 | 169 | |
| 170 | 170 | $has_sensei_shortcode = true; |
| 171 | 171 | } |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - if( $has_sensei_shortcode ) { |
|
| 177 | - $classes[] = 'sensei' ; |
|
| 176 | + if ($has_sensei_shortcode) { |
|
| 177 | + $classes[] = 'sensei'; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | |
@@ -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 | * Renders the [sensei_unpurchased_courses] shortcode when a user is logged in. If the user is not logged in |
@@ -45,21 +45,21 @@ discard block |
||
| 45 | 45 | * @param string $content |
| 46 | 46 | * @param string $shortcode the shortcode that was called for this instance |
| 47 | 47 | */ |
| 48 | - public function __construct( $attributes, $content, $shortcode ){ |
|
| 48 | + public function __construct($attributes, $content, $shortcode) { |
|
| 49 | 49 | |
| 50 | 50 | // set up all argument need for constructing the course query |
| 51 | - $this->number = isset( $attributes['number'] ) ? $attributes['number'] : '10'; |
|
| 52 | - $this->orderby = isset( $attributes['orderby'] ) ? $attributes['orderby'] : 'title'; |
|
| 51 | + $this->number = isset($attributes['number']) ? $attributes['number'] : '10'; |
|
| 52 | + $this->orderby = isset($attributes['orderby']) ? $attributes['orderby'] : 'title'; |
|
| 53 | 53 | |
| 54 | 54 | // set the default for menu_order to be ASC |
| 55 | - if( 'menu_order' == $this->orderby && !isset( $attributes['order'] ) ){ |
|
| 55 | + if ('menu_order' == $this->orderby && ! isset($attributes['order'])) { |
|
| 56 | 56 | |
| 57 | - $this->order = 'ASC'; |
|
| 57 | + $this->order = 'ASC'; |
|
| 58 | 58 | |
| 59 | - }else{ |
|
| 59 | + } else { |
|
| 60 | 60 | |
| 61 | 61 | // for everything else use the value passed or the default DESC |
| 62 | - $this->order = isset( $attributes['order'] ) ? $attributes['order'] : 'DESC'; |
|
| 62 | + $this->order = isset($attributes['order']) ? $attributes['order'] : 'DESC'; |
|
| 63 | 63 | |
| 64 | 64 | } |
| 65 | 65 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * |
| 74 | 74 | * @since 1.9.0 |
| 75 | 75 | */ |
| 76 | - protected function setup_course_query(){ |
|
| 76 | + protected function setup_course_query() { |
|
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | // course query parameters to be used for all courses |
@@ -87,18 +87,18 @@ discard block |
||
| 87 | 87 | ); |
| 88 | 88 | |
| 89 | 89 | // get all the courses that has a product attached |
| 90 | - $all_courses_query = new WP_Query( $query_args ); |
|
| 90 | + $all_courses_query = new WP_Query($query_args); |
|
| 91 | 91 | |
| 92 | 92 | $paid_courses_not_taken = array(); |
| 93 | 93 | // look through all course and find the purchasable ones that user has not purchased |
| 94 | - foreach( $all_courses_query->posts as $course ){ |
|
| 94 | + foreach ($all_courses_query->posts as $course) { |
|
| 95 | 95 | |
| 96 | 96 | // only keep the courses with a product including only courses that the user not taking |
| 97 | - $course_product_id = get_post_meta( $course->ID, '_course_woocommerce_product',true ); |
|
| 98 | - if( is_numeric( $course_product_id ) |
|
| 97 | + $course_product_id = get_post_meta($course->ID, '_course_woocommerce_product', true); |
|
| 98 | + if (is_numeric($course_product_id) |
|
| 99 | 99 | && |
| 100 | - ! Sensei_Utils::user_started_course( $course->ID , get_current_user_id() ) |
|
| 101 | - ){ |
|
| 100 | + ! Sensei_Utils::user_started_course($course->ID, get_current_user_id()) |
|
| 101 | + ) { |
|
| 102 | 102 | |
| 103 | 103 | $paid_courses_not_taken[] = $course->ID; |
| 104 | 104 | |
@@ -108,10 +108,10 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | // setup the course query again and only use the course the user has not purchased. |
| 110 | 110 | // this query will be loaded into the global WP_Query in the render function. |
| 111 | - $query_args[ 'post__in' ] = $paid_courses_not_taken; |
|
| 112 | - $query_args[ 'posts_per_page' ] = $this->number; |
|
| 111 | + $query_args['post__in'] = $paid_courses_not_taken; |
|
| 112 | + $query_args['posts_per_page'] = $this->number; |
|
| 113 | 113 | |
| 114 | - $this->query = new WP_Query( $query_args ); |
|
| 114 | + $this->query = new WP_Query($query_args); |
|
| 115 | 115 | |
| 116 | 116 | }// end setup _course_query |
| 117 | 117 | |
@@ -120,13 +120,13 @@ discard block |
||
| 120 | 120 | * |
| 121 | 121 | * @return string $content |
| 122 | 122 | */ |
| 123 | - public function render(){ |
|
| 123 | + public function render() { |
|
| 124 | 124 | |
| 125 | 125 | global $wp_query; |
| 126 | 126 | |
| 127 | - if ( ! is_user_logged_in() ) { |
|
| 127 | + if ( ! is_user_logged_in()) { |
|
| 128 | 128 | |
| 129 | - $anchor_before = '<a href="' . esc_url( sensei_user_login_url() ) . '" >'; |
|
| 129 | + $anchor_before = '<a href="'.esc_url(sensei_user_login_url()).'" >'; |
|
| 130 | 130 | $anchor_after = '</a>'; |
| 131 | 131 | $notice = sprintf( |
| 132 | 132 | __('You must be logged in to view the non-purchased courses. Click here to %slogin%s.'), |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $anchor_after |
| 135 | 135 | ); |
| 136 | 136 | |
| 137 | - Sensei()->notices->add_notice( $notice, 'info' ); |
|
| 137 | + Sensei()->notices->add_notice($notice, 'info'); |
|
| 138 | 138 | Sensei()->notices->print_notices(); |
| 139 | 139 | |
| 140 | 140 | return ''; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | ob_start(); |
| 150 | 150 | Sensei()->notices->print_notices(); |
| 151 | 151 | Sensei_Templates::get_template('loop-course.php'); |
| 152 | - $shortcode_output = ob_get_clean(); |
|
| 152 | + $shortcode_output = ob_get_clean(); |
|
| 153 | 153 | |
| 154 | 154 | //restore old query |
| 155 | 155 | $wp_query = $current_global_query; |
@@ -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 Results Class |
@@ -23,20 +23,20 @@ discard block |
||
| 23 | 23 | * Constructor. |
| 24 | 24 | * @since 1.4.0 |
| 25 | 25 | */ |
| 26 | - public function __construct () { |
|
| 26 | + public function __construct() { |
|
| 27 | 27 | |
| 28 | 28 | // Setup learner profile URL base |
| 29 | - $this->courses_url_base = apply_filters( 'sensei_course_slug', _x( 'course', 'post type single url slug', 'woothemes-sensei' ) ); |
|
| 29 | + $this->courses_url_base = apply_filters('sensei_course_slug', _x('course', 'post type single url slug', 'woothemes-sensei')); |
|
| 30 | 30 | |
| 31 | 31 | // Setup permalink structure for course results |
| 32 | - add_action( 'init', array( $this, 'setup_permastruct' ) ); |
|
| 33 | - add_filter( 'wp_title', array( $this, 'page_title' ), 10, 2 ); |
|
| 32 | + add_action('init', array($this, 'setup_permastruct')); |
|
| 33 | + add_filter('wp_title', array($this, 'page_title'), 10, 2); |
|
| 34 | 34 | |
| 35 | 35 | // Load course results |
| 36 | - add_action( 'sensei_course_results_content_inside_before', array( $this, 'deprecate_course_result_info_hook' ), 10 ); |
|
| 36 | + add_action('sensei_course_results_content_inside_before', array($this, 'deprecate_course_result_info_hook'), 10); |
|
| 37 | 37 | |
| 38 | 38 | // Add class to body tag |
| 39 | - add_filter( 'body_class', array( $this, 'body_class' ), 10, 1 ); |
|
| 39 | + add_filter('body_class', array($this, 'body_class'), 10, 1); |
|
| 40 | 40 | |
| 41 | 41 | } // End __construct() |
| 42 | 42 | |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | * @return void |
| 47 | 47 | */ |
| 48 | 48 | public function setup_permastruct() { |
| 49 | - add_rewrite_rule( '^' . $this->courses_url_base . '/([^/]*)/results/?', 'index.php?course_results=$matches[1]', 'top' ); |
|
| 50 | - add_rewrite_tag( '%course_results%', '([^&]+)' ); |
|
| 49 | + add_rewrite_rule('^'.$this->courses_url_base.'/([^/]*)/results/?', 'index.php?course_results=$matches[1]', 'top'); |
|
| 50 | + add_rewrite_tag('%course_results%', '([^&]+)'); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -56,11 +56,11 @@ discard block |
||
| 56 | 56 | * @param string $sep Seeparator string |
| 57 | 57 | * @return string Modified title |
| 58 | 58 | */ |
| 59 | - public function page_title( $title, $sep = null ) { |
|
| 59 | + public function page_title($title, $sep = null) { |
|
| 60 | 60 | global $wp_query; |
| 61 | - if( isset( $wp_query->query_vars['course_results'] ) ) { |
|
| 62 | - $course = get_page_by_path( $wp_query->query_vars['course_results'], OBJECT, 'course' ); |
|
| 63 | - $title = __( 'Course Results: ', 'woothemes-sensei' ) . $course->post_title . ' ' . $sep . ' '; |
|
| 61 | + if (isset($wp_query->query_vars['course_results'])) { |
|
| 62 | + $course = get_page_by_path($wp_query->query_vars['course_results'], OBJECT, 'course'); |
|
| 63 | + $title = __('Course Results: ', 'woothemes-sensei').$course->post_title.' '.$sep.' '; |
|
| 64 | 64 | } |
| 65 | 65 | return $title; |
| 66 | 66 | } |
@@ -71,18 +71,18 @@ discard block |
||
| 71 | 71 | * @param integer $course_id ID of course |
| 72 | 72 | * @return string The course results page permalink |
| 73 | 73 | */ |
| 74 | - public function get_permalink( $course_id = 0 ) { |
|
| 74 | + public function get_permalink($course_id = 0) { |
|
| 75 | 75 | |
| 76 | 76 | $permalink = ''; |
| 77 | 77 | |
| 78 | - if( $course_id > 0 ) { |
|
| 78 | + if ($course_id > 0) { |
|
| 79 | 79 | |
| 80 | - $course = get_post( $course_id ); |
|
| 80 | + $course = get_post($course_id); |
|
| 81 | 81 | |
| 82 | - if ( get_option('permalink_structure') ) { |
|
| 83 | - $permalink = trailingslashit( get_home_url() ) . $this->courses_url_base . '/' . $course->post_name . '/results/'; |
|
| 82 | + if (get_option('permalink_structure')) { |
|
| 83 | + $permalink = trailingslashit(get_home_url()).$this->courses_url_base.'/'.$course->post_name.'/results/'; |
|
| 84 | 84 | } else { |
| 85 | - $permalink = trailingslashit( get_home_url() ) . '?course_results=' . $course->post_name; |
|
| 85 | + $permalink = trailingslashit(get_home_url()).'?course_results='.$course->post_name; |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
@@ -95,10 +95,10 @@ discard block |
||
| 95 | 95 | * @return void |
| 96 | 96 | */ |
| 97 | 97 | public function content() { |
| 98 | - global $wp_query, $current_user; |
|
| 98 | + global $wp_query, $current_user; |
|
| 99 | 99 | |
| 100 | - if( isset( $wp_query->query_vars['course_results'] ) ) { |
|
| 101 | - Sensei_Templates::get_template( 'course-results/course-info.php' ); |
|
| 100 | + if (isset($wp_query->query_vars['course_results'])) { |
|
| 101 | + Sensei_Templates::get_template('course-results/course-info.php'); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | } |
@@ -112,12 +112,12 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | global $course; |
| 114 | 114 | |
| 115 | - $course_status = Sensei_Utils::sensei_user_course_status_message( $course->ID, get_current_user_id()); |
|
| 116 | - echo '<div class="sensei-message ' . $course_status['box_class'] . '">' . $course_status['message'] . '</div>'; |
|
| 115 | + $course_status = Sensei_Utils::sensei_user_course_status_message($course->ID, get_current_user_id()); |
|
| 116 | + echo '<div class="sensei-message '.$course_status['box_class'].'">'.$course_status['message'].'</div>'; |
|
| 117 | 117 | |
| 118 | - sensei_do_deprecated_action( 'sensei_course_results_lessons','1.9.','sensei_course_results_content_inside_after', $course ); |
|
| 118 | + sensei_do_deprecated_action('sensei_course_results_lessons', '1.9.', 'sensei_course_results_content_inside_after', $course); |
|
| 119 | 119 | |
| 120 | - sensei_do_deprecated_action( 'sensei_course_results_bottom','1.9.','sensei_course_results_content_inside_after', $course->ID ); |
|
| 120 | + sensei_do_deprecated_action('sensei_course_results_bottom', '1.9.', 'sensei_course_results_content_inside_after', $course->ID); |
|
| 121 | 121 | |
| 122 | 122 | } |
| 123 | 123 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | public function course_lessons() { |
| 131 | 131 | |
| 132 | 132 | global $course; |
| 133 | - _deprecated_function( 'Sensei_modules course_lessons ', '1.9.0' ); |
|
| 133 | + _deprecated_function('Sensei_modules course_lessons ', '1.9.0'); |
|
| 134 | 134 | |
| 135 | 135 | } |
| 136 | 136 | |
@@ -139,9 +139,9 @@ discard block |
||
| 139 | 139 | * @param array $classes Existing classes |
| 140 | 140 | * @return array Modified classes |
| 141 | 141 | */ |
| 142 | - public function body_class( $classes ) { |
|
| 142 | + public function body_class($classes) { |
|
| 143 | 143 | global $wp_query; |
| 144 | - if( isset( $wp_query->query_vars['course_results'] ) ) { |
|
| 144 | + if (isset($wp_query->query_vars['course_results'])) { |
|
| 145 | 145 | $classes[] = 'course-results'; |
| 146 | 146 | } |
| 147 | 147 | return $classes; |
@@ -152,9 +152,9 @@ discard block |
||
| 152 | 152 | * |
| 153 | 153 | * @deprecated since 1.9.0 |
| 154 | 154 | */ |
| 155 | - public static function deprecate_sensei_course_results_content_hook(){ |
|
| 155 | + public static function deprecate_sensei_course_results_content_hook() { |
|
| 156 | 156 | |
| 157 | - sensei_do_deprecated_action('sensei_course_results_content', '1.9.0','sensei_course_results_content_before'); |
|
| 157 | + sensei_do_deprecated_action('sensei_course_results_content', '1.9.0', 'sensei_course_results_content_before'); |
|
| 158 | 158 | |
| 159 | 159 | } |
| 160 | 160 | |
@@ -163,9 +163,9 @@ discard block |
||
| 163 | 163 | * |
| 164 | 164 | * @since 1.9.0 |
| 165 | 165 | */ |
| 166 | - public static function fire_sensei_message_hook(){ |
|
| 166 | + public static function fire_sensei_message_hook() { |
|
| 167 | 167 | |
| 168 | - do_action( 'sensei_frontend_messages' ); |
|
| 168 | + do_action('sensei_frontend_messages'); |
|
| 169 | 169 | |
| 170 | 170 | } |
| 171 | 171 | |
@@ -174,9 +174,9 @@ discard block |
||
| 174 | 174 | * |
| 175 | 175 | * @since 1.9.0 |
| 176 | 176 | */ |
| 177 | - public static function deprecate_course_result_info_hook(){ |
|
| 177 | + public static function deprecate_course_result_info_hook() { |
|
| 178 | 178 | |
| 179 | - sensei_do_deprecated_action( 'sensei_course_results_info', '1.9.0', 'sensei_course_results_content_inside_before' ); |
|
| 179 | + sensei_do_deprecated_action('sensei_course_results_info', '1.9.0', 'sensei_course_results_content_inside_before'); |
|
| 180 | 180 | |
| 181 | 181 | } |
| 182 | 182 | |
@@ -185,10 +185,10 @@ discard block |
||
| 185 | 185 | * |
| 186 | 186 | * @deprecate since 1.9.0 |
| 187 | 187 | */ |
| 188 | - public static function deprecate_course_results_top_hook(){ |
|
| 188 | + public static function deprecate_course_results_top_hook() { |
|
| 189 | 189 | |
| 190 | 190 | global $course; |
| 191 | - sensei_do_deprecated_action( 'sensei_course_results_top', '1.9.0' ,'sensei_course_results_content_inside_before',$course->ID ); |
|
| 191 | + sensei_do_deprecated_action('sensei_course_results_top', '1.9.0', 'sensei_course_results_content_inside_before', $course->ID); |
|
| 192 | 192 | |
| 193 | 193 | } |
| 194 | 194 | |
@@ -197,10 +197,10 @@ discard block |
||
| 197 | 197 | * |
| 198 | 198 | * @since 1.8.0 |
| 199 | 199 | */ |
| 200 | - public static function fire_course_image_hook(){ |
|
| 200 | + public static function fire_course_image_hook() { |
|
| 201 | 201 | |
| 202 | 202 | global $course; |
| 203 | - sensei_do_deprecated_action('sensei_course_image','1.9.0', 'sensei_single_course_content_inside_before', array( get_the_ID()) ); |
|
| 203 | + sensei_do_deprecated_action('sensei_course_image', '1.9.0', 'sensei_single_course_content_inside_before', array(get_the_ID())); |
|
| 204 | 204 | |
| 205 | 205 | } |
| 206 | 206 | |
@@ -211,4 +211,4 @@ discard block |
||
| 211 | 211 | * for backward compatibility |
| 212 | 212 | * @since 1.9.0 |
| 213 | 213 | */ |
| 214 | -class WooThemes_Sensei_Course_Results extends Sensei_Course_Results{} |
|
| 214 | +class WooThemes_Sensei_Course_Results extends Sensei_Course_Results {} |
|
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | +if ( ! defined('ABSPATH')) { |
|
| 4 | 4 | exit; // Exit if accessed directly |
| 5 | 5 | } |
| 6 | 6 | |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | * Initialize the language pack manager |
| 29 | 29 | */ |
| 30 | 30 | public function __construct() { |
| 31 | - add_action( 'update_option_WPLANG', array( $this, 'updated_language_option' ), 10, 2 ); |
|
| 32 | - add_filter( 'admin_init', array( $this, 'language_package_actions' ), 10 ); |
|
| 31 | + add_action('update_option_WPLANG', array($this, 'updated_language_option'), 10, 2); |
|
| 32 | + add_filter('admin_init', array($this, 'language_package_actions'), 10); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | * |
| 40 | 40 | * @return string |
| 41 | 41 | */ |
| 42 | - public static function get_package_uri( $locale ) { |
|
| 43 | - return self::$repo . Sensei()->version . '/packages/' . $locale . '.zip'; |
|
| 42 | + public static function get_package_uri($locale) { |
|
| 43 | + return self::$repo.Sensei()->version.'/packages/'.$locale.'.zip'; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | * |
| 51 | 51 | * @return string |
| 52 | 52 | */ |
| 53 | - protected static function get_settings_uri( $action ) { |
|
| 54 | - return wp_nonce_url( admin_url( 'admin.php?page=woothemes-sensei-settings&action=' . $action ), 'language_pack', '_sensei_language_nonce' ); |
|
| 53 | + protected static function get_settings_uri($action) { |
|
| 54 | + return wp_nonce_url(admin_url('admin.php?page=woothemes-sensei-settings&action='.$action), 'language_pack', '_sensei_language_nonce'); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * @return string |
| 61 | 61 | */ |
| 62 | 62 | public static function get_install_uri() { |
| 63 | - return self::get_settings_uri( 'language_pack_install' ); |
|
| 63 | + return self::get_settings_uri('language_pack_install'); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * @return string |
| 70 | 70 | */ |
| 71 | 71 | public static function get_dismiss_uri() { |
| 72 | - return self::get_settings_uri( 'dismiss_language_pack_notice' ); |
|
| 72 | + return self::get_settings_uri('dismiss_language_pack_notice'); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -78,8 +78,8 @@ discard block |
||
| 78 | 78 | * @param string $old |
| 79 | 79 | * @param string $new |
| 80 | 80 | */ |
| 81 | - public function updated_language_option( $old, $new ) { |
|
| 82 | - self::has_language_pack_available( $new ); |
|
| 81 | + public function updated_language_option($old, $new) { |
|
| 82 | + self::has_language_pack_available($new); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -89,42 +89,42 @@ discard block |
||
| 89 | 89 | * |
| 90 | 90 | * @return bool |
| 91 | 91 | */ |
| 92 | - public static function has_language_pack_available( $locale = null ) { |
|
| 92 | + public static function has_language_pack_available($locale = null) { |
|
| 93 | 93 | |
| 94 | - if ( is_null( $locale ) ) { |
|
| 94 | + if (is_null($locale)) { |
|
| 95 | 95 | |
| 96 | 96 | $locale = get_locale(); |
| 97 | 97 | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - if ( 'en_US' === $locale ) { |
|
| 100 | + if ('en_US' === $locale) { |
|
| 101 | 101 | |
| 102 | 102 | return false; |
| 103 | 103 | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - if ( 'yes' === get_option( 'sensei_needs_language_pack_install' ) ) { |
|
| 106 | + if ('yes' === get_option('sensei_needs_language_pack_install')) { |
|
| 107 | 107 | |
| 108 | 108 | return true; |
| 109 | 109 | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - if( isset( $_GET['translation_updated'] ) && 5 == $_GET['translation_updated'] ){ |
|
| 112 | + if (isset($_GET['translation_updated']) && 5 == $_GET['translation_updated']) { |
|
| 113 | 113 | |
| 114 | 114 | return false; |
| 115 | 115 | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - $version = get_option( 'woothemes_sensei_language_pack_version', array( '0', $locale ) ); |
|
| 118 | + $version = get_option('woothemes_sensei_language_pack_version', array('0', $locale)); |
|
| 119 | 119 | |
| 120 | - if ( ! is_array( $version ) || version_compare( $version[0], Sensei()->version, '<' ) || $version[1] !== $locale ) { |
|
| 121 | - if ( self::check_if_language_pack_exists( $locale ) ) { |
|
| 122 | - update_option( 'sensei_needs_language_pack_install', 'yes' ); |
|
| 120 | + if ( ! is_array($version) || version_compare($version[0], Sensei()->version, '<') || $version[1] !== $locale) { |
|
| 121 | + if (self::check_if_language_pack_exists($locale)) { |
|
| 122 | + update_option('sensei_needs_language_pack_install', 'yes'); |
|
| 123 | 123 | |
| 124 | 124 | return true; |
| 125 | 125 | } else { |
| 126 | 126 | // Updated the woothemes_sensei_language_pack_version to avoid searching translations for this release again |
| 127 | - self::update_language_pack_version( $locale ); |
|
| 127 | + self::update_language_pack_version($locale); |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | * |
| 138 | 138 | * @return bool |
| 139 | 139 | */ |
| 140 | - public static function check_if_language_pack_exists( $locale ) { |
|
| 141 | - $response = wp_safe_remote_get( self::get_package_uri( $locale ), array( 'timeout' => 60 ) ); |
|
| 140 | + public static function check_if_language_pack_exists($locale) { |
|
| 141 | + $response = wp_safe_remote_get(self::get_package_uri($locale), array('timeout' => 60)); |
|
| 142 | 142 | |
| 143 | - if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
| 143 | + if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { |
|
| 144 | 144 | return true; |
| 145 | 145 | } else { |
| 146 | 146 | return false; |
@@ -152,12 +152,12 @@ discard block |
||
| 152 | 152 | * |
| 153 | 153 | * @param string $locale |
| 154 | 154 | */ |
| 155 | - public static function update_language_pack_version( $locale ) { |
|
| 155 | + public static function update_language_pack_version($locale) { |
|
| 156 | 156 | // Update the language pack version |
| 157 | - update_option( 'woothemes_sensei_language_pack_version', array( Sensei()->version, $locale ) ); |
|
| 157 | + update_option('woothemes_sensei_language_pack_version', array(Sensei()->version, $locale)); |
|
| 158 | 158 | |
| 159 | 159 | // Remove the translation upgrade notice |
| 160 | - update_option( 'sensei_needs_language_pack_install', 'no' ); |
|
| 160 | + update_option('sensei_needs_language_pack_install', 'no'); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -166,17 +166,17 @@ discard block |
||
| 166 | 166 | public function language_package_actions() { |
| 167 | 167 | if ( |
| 168 | 168 | is_admin() |
| 169 | - && current_user_can( 'update_plugins' ) |
|
| 170 | - && isset( $_GET['page'] ) |
|
| 169 | + && current_user_can('update_plugins') |
|
| 170 | + && isset($_GET['page']) |
|
| 171 | 171 | && 'woothemes-sensei-settings' === $_GET['page'] |
| 172 | - && isset( $_GET['action'] ) |
|
| 172 | + && isset($_GET['action']) |
|
| 173 | 173 | ) { |
| 174 | 174 | |
| 175 | - if ( 'language_pack_install' === $_GET['action'] ) { |
|
| 175 | + if ('language_pack_install' === $_GET['action']) { |
|
| 176 | 176 | $this->language_pack_install(); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - if ( 'dismiss_language_pack_notice' ) { |
|
| 179 | + if ('dismiss_language_pack_notice') { |
|
| 180 | 180 | $this->dismiss_language_pack_notice(); |
| 181 | 181 | } |
| 182 | 182 | } |
@@ -186,66 +186,66 @@ discard block |
||
| 186 | 186 | * Install language pack. |
| 187 | 187 | */ |
| 188 | 188 | protected function language_pack_install() { |
| 189 | - $url = wp_nonce_url( admin_url( 'admin.php?page=woothemes-sensei-settings&action=language_pack_install' ), 'language_install' ); |
|
| 190 | - $settings_url = admin_url( 'admin.php?page=woothemes-sensei-settings' ); |
|
| 189 | + $url = wp_nonce_url(admin_url('admin.php?page=woothemes-sensei-settings&action=language_pack_install'), 'language_install'); |
|
| 190 | + $settings_url = admin_url('admin.php?page=woothemes-sensei-settings'); |
|
| 191 | 191 | $locale = get_locale(); |
| 192 | 192 | |
| 193 | - if ( ! isset( $_REQUEST['_sensei_language_nonce'] ) && wp_verify_nonce( $_REQUEST['_sensei_language_nonce'], 'language_pack' ) ) { |
|
| 194 | - wp_redirect( add_query_arg( array( 'translation_updated' => 2 ), $settings_url ) ); |
|
| 193 | + if ( ! isset($_REQUEST['_sensei_language_nonce']) && wp_verify_nonce($_REQUEST['_sensei_language_nonce'], 'language_pack')) { |
|
| 194 | + wp_redirect(add_query_arg(array('translation_updated' => 2), $settings_url)); |
|
| 195 | 195 | exit; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | - if ( 'en_US' === $locale || ! self::check_if_language_pack_exists( $locale ) ) { |
|
| 199 | - wp_redirect( add_query_arg( array( 'translation_updated' => 3 ), $settings_url ) ); |
|
| 198 | + if ('en_US' === $locale || ! self::check_if_language_pack_exists($locale)) { |
|
| 199 | + wp_redirect(add_query_arg(array('translation_updated' => 3), $settings_url)); |
|
| 200 | 200 | exit; |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | - if ( false === ( $creds = request_filesystem_credentials( $url, '', false, false, null ) ) ) { |
|
| 204 | - wp_redirect( add_query_arg( array( 'translation_updated' => 4 ), $settings_url ) ); |
|
| 203 | + if (false === ($creds = request_filesystem_credentials($url, '', false, false, null))) { |
|
| 204 | + wp_redirect(add_query_arg(array('translation_updated' => 4), $settings_url)); |
|
| 205 | 205 | exit; |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - if ( ! WP_Filesystem( $creds ) ) { |
|
| 209 | - request_filesystem_credentials( $url, '', true, false, null ); |
|
| 208 | + if ( ! WP_Filesystem($creds)) { |
|
| 209 | + request_filesystem_credentials($url, '', true, false, null); |
|
| 210 | 210 | |
| 211 | - wp_redirect( add_query_arg( array( 'translation_updated' => 4 ), $settings_url ) ); |
|
| 211 | + wp_redirect(add_query_arg(array('translation_updated' => 4), $settings_url)); |
|
| 212 | 212 | exit; |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | // Download the language pack |
| 216 | - $response = wp_safe_remote_get( self::get_package_uri( $locale ), array( 'timeout' => 60 ) ); |
|
| 217 | - if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
| 216 | + $response = wp_safe_remote_get(self::get_package_uri($locale), array('timeout' => 60)); |
|
| 217 | + if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { |
|
| 218 | 218 | global $wp_filesystem; |
| 219 | 219 | |
| 220 | 220 | $upload_dir = wp_upload_dir(); |
| 221 | - $file = trailingslashit( $upload_dir['path'] ) . $locale . '.zip'; |
|
| 221 | + $file = trailingslashit($upload_dir['path']).$locale.'.zip'; |
|
| 222 | 222 | |
| 223 | 223 | // Save the zip file |
| 224 | - if ( ! $wp_filesystem->put_contents( $file, $response['body'], FS_CHMOD_FILE ) ) { |
|
| 225 | - wp_redirect( add_query_arg( array( 'translation_updated' => 4 ), $settings_url ) ); |
|
| 224 | + if ( ! $wp_filesystem->put_contents($file, $response['body'], FS_CHMOD_FILE)) { |
|
| 225 | + wp_redirect(add_query_arg(array('translation_updated' => 4), $settings_url)); |
|
| 226 | 226 | exit; |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | // Unzip the file to wp-content/languages/plugins directory |
| 230 | - $dir = trailingslashit( WP_LANG_DIR ) . 'plugins/'; |
|
| 231 | - $unzip = unzip_file( $file, $dir ); |
|
| 232 | - if ( true !== $unzip ) { |
|
| 233 | - wp_redirect( add_query_arg( array( 'translation_updated' => 4 ), $settings_url ) ); |
|
| 230 | + $dir = trailingslashit(WP_LANG_DIR).'plugins/'; |
|
| 231 | + $unzip = unzip_file($file, $dir); |
|
| 232 | + if (true !== $unzip) { |
|
| 233 | + wp_redirect(add_query_arg(array('translation_updated' => 4), $settings_url)); |
|
| 234 | 234 | exit; |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | // Delete the package file |
| 238 | - $wp_filesystem->delete( $file ); |
|
| 238 | + $wp_filesystem->delete($file); |
|
| 239 | 239 | |
| 240 | 240 | // Update version and remove notice |
| 241 | - self::update_language_pack_version( $locale ); |
|
| 241 | + self::update_language_pack_version($locale); |
|
| 242 | 242 | |
| 243 | 243 | // Redirect and show a success message |
| 244 | - wp_redirect( add_query_arg( array( 'translation_updated' => 1 ), $settings_url ) ); |
|
| 244 | + wp_redirect(add_query_arg(array('translation_updated' => 1), $settings_url)); |
|
| 245 | 245 | exit; |
| 246 | 246 | } else { |
| 247 | 247 | // Don't have a valid package for the current language! |
| 248 | - wp_redirect( add_query_arg( array( 'translation_updated' => 5 ), $settings_url ) ); |
|
| 248 | + wp_redirect(add_query_arg(array('translation_updated' => 5), $settings_url)); |
|
| 249 | 249 | exit; |
| 250 | 250 | } |
| 251 | 251 | } |
@@ -254,38 +254,38 @@ discard block |
||
| 254 | 254 | * Hide language pack notice. |
| 255 | 255 | */ |
| 256 | 256 | protected function dismiss_language_pack_notice() { |
| 257 | - if ( ! isset( $_REQUEST['_sensei_language_nonce'] ) && wp_verify_nonce( $_REQUEST['_sensei_language_nonce'], 'language_pack' ) ) { |
|
| 258 | - wp_die( __( 'Cheatin’ huh?', 'woothemes-sensei' ) ); |
|
| 257 | + if ( ! isset($_REQUEST['_sensei_language_nonce']) && wp_verify_nonce($_REQUEST['_sensei_language_nonce'], 'language_pack')) { |
|
| 258 | + wp_die(__('Cheatin’ huh?', 'woothemes-sensei')); |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | // Update version and remove notice |
| 262 | - self::update_language_pack_version( get_locale() ); |
|
| 262 | + self::update_language_pack_version(get_locale()); |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | /** |
| 266 | 266 | * Language pack messages |
| 267 | 267 | */ |
| 268 | 268 | public static function messages() { |
| 269 | - if ( empty( $_GET['translation_updated'] ) ) { |
|
| 269 | + if (empty($_GET['translation_updated'])) { |
|
| 270 | 270 | return; |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | - switch ( $_GET['translation_updated'] ) { |
|
| 273 | + switch ($_GET['translation_updated']) { |
|
| 274 | 274 | case 2 : |
| 275 | - echo '<div class="error"><p>' . __( 'Failed to install/update the translation:', 'woothemes-sensei' ) . ' ' . __( 'Seems you don\'t have permission to do this!', 'woothemes-sensei' ) . '</p></div>'; |
|
| 275 | + echo '<div class="error"><p>'.__('Failed to install/update the translation:', 'woothemes-sensei').' '.__('Seems you don\'t have permission to do this!', 'woothemes-sensei').'</p></div>'; |
|
| 276 | 276 | break; |
| 277 | 277 | case 3 : |
| 278 | - echo '<div class="error"><p>' . __( 'Failed to install/update the translation:', 'woothemes-sensei' ) . ' ' . __( 'There is no translation available for your language!', 'woothemes-sensei' ) . '</p></div>'; |
|
| 278 | + echo '<div class="error"><p>'.__('Failed to install/update the translation:', 'woothemes-sensei').' '.__('There is no translation available for your language!', 'woothemes-sensei').'</p></div>'; |
|
| 279 | 279 | break; |
| 280 | 280 | case 4 : |
| 281 | - echo '<div class="error"><p>' . __( 'Failed to install/update the translation:', 'woothemes-sensei' ) . ' ' . sprintf( __( 'An authentication error occurred while updating the translation. Please try again or configure your %sUpgrade Constants%s.', 'woothemes-sensei' ), '<a href="http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants">', '</a>' ) . '</p></div>'; |
|
| 281 | + echo '<div class="error"><p>'.__('Failed to install/update the translation:', 'woothemes-sensei').' '.sprintf(__('An authentication error occurred while updating the translation. Please try again or configure your %sUpgrade Constants%s.', 'woothemes-sensei'), '<a href="http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants">', '</a>').'</p></div>'; |
|
| 282 | 282 | break; |
| 283 | 283 | case 5 : |
| 284 | - echo '<div class="error"><p>' . __( 'Failed to install/update the translation:', 'woothemes-sensei' ) . ' ' . __( 'Sorry but there is no translation available for your language =/', 'woothemes-sensei' ) . '</p></div>'; |
|
| 284 | + echo '<div class="error"><p>'.__('Failed to install/update the translation:', 'woothemes-sensei').' '.__('Sorry but there is no translation available for your language =/', 'woothemes-sensei').'</p></div>'; |
|
| 285 | 285 | break; |
| 286 | 286 | |
| 287 | 287 | default : |
| 288 | - echo '<div class="updated"><p>' . __( 'Translations installed/updated successfully!', 'woothemes-sensei' ) . '</p></div>'; |
|
| 288 | + echo '<div class="updated"><p>'.__('Translations installed/updated successfully!', 'woothemes-sensei').'</p></div>'; |
|
| 289 | 289 | break; |
| 290 | 290 | } |
| 291 | 291 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // security check, don't load file outside WP |
|
| 2 | +if ( ! defined('ABSPATH')) exit; // security check, don't load file outside WP |
|
| 3 | 3 | /** |
| 4 | 4 | * Sensei Template Class |
| 5 | 5 | * |
@@ -20,38 +20,38 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | * @return void |
| 22 | 22 | */ |
| 23 | - public static function get_part( $slug, $name = '' ){ |
|
| 23 | + public static function get_part($slug, $name = '') { |
|
| 24 | 24 | |
| 25 | 25 | $template = ''; |
| 26 | 26 | $plugin_template_url = Sensei()->template_url; |
| 27 | - $plugin_template_path = Sensei()->plugin_path() . "/templates/"; |
|
| 27 | + $plugin_template_path = Sensei()->plugin_path()."/templates/"; |
|
| 28 | 28 | |
| 29 | 29 | // Look in yourtheme/slug-name.php and yourtheme/sensei/slug-name.php |
| 30 | - if ( $name ){ |
|
| 30 | + if ($name) { |
|
| 31 | 31 | |
| 32 | - $template = locate_template( array ( "{$slug}-{$name}.php", "{$plugin_template_url}{$slug}-{$name}.php" ) ); |
|
| 32 | + $template = locate_template(array("{$slug}-{$name}.php", "{$plugin_template_url}{$slug}-{$name}.php")); |
|
| 33 | 33 | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | // Get default slug-name.php |
| 37 | - if ( ! $template && $name && file_exists( $plugin_template_path . "{$slug}-{$name}.php" ) ){ |
|
| 37 | + if ( ! $template && $name && file_exists($plugin_template_path."{$slug}-{$name}.php")) { |
|
| 38 | 38 | |
| 39 | - $template = $plugin_template_path . "{$slug}-{$name}.php"; |
|
| 39 | + $template = $plugin_template_path."{$slug}-{$name}.php"; |
|
| 40 | 40 | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
| 44 | 44 | // If template file doesn't exist, look in yourtheme/slug.php and yourtheme/sensei/slug.php |
| 45 | - if ( !$template ){ |
|
| 45 | + if ( ! $template) { |
|
| 46 | 46 | |
| 47 | - $template = locate_template( array ( "{$slug}.php", "{$plugin_template_url}{$slug}.php" ) ); |
|
| 47 | + $template = locate_template(array("{$slug}.php", "{$plugin_template_url}{$slug}.php")); |
|
| 48 | 48 | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | - if ( $template ){ |
|
| 52 | + if ($template) { |
|
| 53 | 53 | |
| 54 | - load_template( $template, false ); |
|
| 54 | + load_template($template, false); |
|
| 55 | 55 | |
| 56 | 56 | } |
| 57 | 57 | |
@@ -67,20 +67,20 @@ discard block |
||
| 67 | 67 | * @param string $template_path |
| 68 | 68 | * @param string $default_path |
| 69 | 69 | */ |
| 70 | - public static function get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) { |
|
| 70 | + public static function get_template($template_name, $args = array(), $template_path = '', $default_path = '') { |
|
| 71 | 71 | |
| 72 | - if ( $args && is_array($args) ) |
|
| 73 | - extract( $args ); |
|
| 72 | + if ($args && is_array($args)) |
|
| 73 | + extract($args); |
|
| 74 | 74 | |
| 75 | - $located = self::locate_template( $template_name, $template_path, $default_path ); |
|
| 75 | + $located = self::locate_template($template_name, $template_path, $default_path); |
|
| 76 | 76 | |
| 77 | - if( ! empty( $located ) ){ |
|
| 77 | + if ( ! empty($located)) { |
|
| 78 | 78 | |
| 79 | - do_action( 'sensei_before_template_part', $template_name, $template_path, $located ); |
|
| 79 | + do_action('sensei_before_template_part', $template_name, $template_path, $located); |
|
| 80 | 80 | |
| 81 | - include( $located ); |
|
| 81 | + include($located); |
|
| 82 | 82 | |
| 83 | - do_action( 'sensei_after_template_part', $template_name, $template_path, $located ); |
|
| 83 | + do_action('sensei_after_template_part', $template_name, $template_path, $located); |
|
| 84 | 84 | |
| 85 | 85 | } |
| 86 | 86 | |
@@ -97,32 +97,32 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | * @return mixed|void |
| 99 | 99 | */ |
| 100 | - public static function locate_template( $template_name, $template_path = '', $default_path = '' ) { |
|
| 100 | + public static function locate_template($template_name, $template_path = '', $default_path = '') { |
|
| 101 | 101 | |
| 102 | - if ( ! $template_path ) $template_path = Sensei()->template_url; |
|
| 103 | - if ( ! $default_path ) $default_path = Sensei()->plugin_path() . '/templates/'; |
|
| 102 | + if ( ! $template_path) $template_path = Sensei()->template_url; |
|
| 103 | + if ( ! $default_path) $default_path = Sensei()->plugin_path().'/templates/'; |
|
| 104 | 104 | |
| 105 | 105 | // Look within passed path within the theme - this is priority |
| 106 | 106 | $template = locate_template( |
| 107 | 107 | array( |
| 108 | - $template_path . $template_name, |
|
| 108 | + $template_path.$template_name, |
|
| 109 | 109 | $template_name |
| 110 | 110 | ) |
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | 113 | // Get default template |
| 114 | - if ( ! $template ){ |
|
| 114 | + if ( ! $template) { |
|
| 115 | 115 | |
| 116 | - $template = $default_path . $template_name; |
|
| 116 | + $template = $default_path.$template_name; |
|
| 117 | 117 | |
| 118 | 118 | } |
| 119 | 119 | // return nothing for file that do not exist |
| 120 | - if( !file_exists( $template ) ){ |
|
| 120 | + if ( ! file_exists($template)) { |
|
| 121 | 121 | $template = ''; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | // Return what we found |
| 125 | - return apply_filters( 'sensei_locate_template', $template, $template_name, $template_path ); |
|
| 125 | + return apply_filters('sensei_locate_template', $template, $template_name, $template_path); |
|
| 126 | 126 | |
| 127 | 127 | } // end locate |
| 128 | 128 | |
@@ -135,30 +135,30 @@ discard block |
||
| 135 | 135 | * @param string $template |
| 136 | 136 | * @return string $template |
| 137 | 137 | */ |
| 138 | - public static function template_loader ( $template = '' ) { |
|
| 138 | + public static function template_loader($template = '') { |
|
| 139 | 139 | |
| 140 | 140 | global $wp_query, $email_template; |
| 141 | 141 | |
| 142 | - $find = array( 'woothemes-sensei.php' ); |
|
| 142 | + $find = array('woothemes-sensei.php'); |
|
| 143 | 143 | $file = ''; |
| 144 | 144 | |
| 145 | - if ( isset( $email_template ) && $email_template ) { |
|
| 145 | + if (isset($email_template) && $email_template) { |
|
| 146 | 146 | |
| 147 | - $file = 'emails/' . $email_template; |
|
| 147 | + $file = 'emails/'.$email_template; |
|
| 148 | 148 | $find[] = $file; |
| 149 | - $find[] = Sensei()->template_url . $file; |
|
| 149 | + $find[] = Sensei()->template_url.$file; |
|
| 150 | 150 | |
| 151 | - } elseif ( is_single() && get_post_type() == 'course' ) { |
|
| 151 | + } elseif (is_single() && get_post_type() == 'course') { |
|
| 152 | 152 | |
| 153 | - if ( Sensei()->check_user_permissions( 'course-single' ) ) { |
|
| 153 | + if (Sensei()->check_user_permissions('course-single')) { |
|
| 154 | 154 | |
| 155 | 155 | // possible backward compatible template include if theme overrides content-single-course.php |
| 156 | 156 | // this template was removed in 1.9.0 and code all moved into the main single-course.php file |
| 157 | - self::locate_and_load_template_overrides( Sensei()->template_url . 'content-single-course.php', true ); |
|
| 157 | + self::locate_and_load_template_overrides(Sensei()->template_url.'content-single-course.php', true); |
|
| 158 | 158 | |
| 159 | - $file = 'single-course.php'; |
|
| 159 | + $file = 'single-course.php'; |
|
| 160 | 160 | $find[] = $file; |
| 161 | - $find[] = Sensei()->template_url . $file; |
|
| 161 | + $find[] = Sensei()->template_url.$file; |
|
| 162 | 162 | |
| 163 | 163 | } else { |
| 164 | 164 | |
@@ -167,17 +167,17 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | } // End If Statement |
| 169 | 169 | |
| 170 | - } elseif ( is_single() && get_post_type() == 'lesson' ) { |
|
| 170 | + } elseif (is_single() && get_post_type() == 'lesson') { |
|
| 171 | 171 | |
| 172 | - if ( Sensei()->check_user_permissions( 'lesson-single' ) ) { |
|
| 172 | + if (Sensei()->check_user_permissions('lesson-single')) { |
|
| 173 | 173 | |
| 174 | 174 | // possible backward compatible template include if theme overrides content-single-lesson.php |
| 175 | 175 | // this template was removed in 1.9.0 and code all moved into the main single-lesson.php file |
| 176 | - self::locate_and_load_template_overrides( Sensei()->template_url . 'content-single-lesson.php', true ); |
|
| 176 | + self::locate_and_load_template_overrides(Sensei()->template_url.'content-single-lesson.php', true); |
|
| 177 | 177 | |
| 178 | - $file = 'single-lesson.php'; |
|
| 178 | + $file = 'single-lesson.php'; |
|
| 179 | 179 | $find[] = $file; |
| 180 | - $find[] = Sensei()->template_url . $file; |
|
| 180 | + $find[] = Sensei()->template_url.$file; |
|
| 181 | 181 | |
| 182 | 182 | } else { |
| 183 | 183 | |
@@ -186,17 +186,17 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | } // End If Statement |
| 188 | 188 | |
| 189 | - } elseif ( is_single() && get_post_type() == 'quiz' ) { |
|
| 189 | + } elseif (is_single() && get_post_type() == 'quiz') { |
|
| 190 | 190 | |
| 191 | - if ( Sensei()->check_user_permissions( 'quiz-single' ) ) { |
|
| 191 | + if (Sensei()->check_user_permissions('quiz-single')) { |
|
| 192 | 192 | |
| 193 | 193 | // possible backward compatible template include if theme overrides content-single-quiz.php |
| 194 | 194 | // this template was removed in 1.9.0 and code all moved into the main single-quiz.php file |
| 195 | - self::locate_and_load_template_overrides( Sensei()->template_url . 'content-single-quiz.php' , true); |
|
| 195 | + self::locate_and_load_template_overrides(Sensei()->template_url.'content-single-quiz.php', true); |
|
| 196 | 196 | |
| 197 | - $file = 'single-quiz.php'; |
|
| 197 | + $file = 'single-quiz.php'; |
|
| 198 | 198 | $find[] = $file; |
| 199 | - $find[] = Sensei()->template_url . $file; |
|
| 199 | + $find[] = Sensei()->template_url.$file; |
|
| 200 | 200 | |
| 201 | 201 | } else { |
| 202 | 202 | |
@@ -205,76 +205,76 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | } // End If Statement |
| 207 | 207 | |
| 208 | - } elseif ( is_single() && get_post_type() == 'sensei_message' ) { |
|
| 208 | + } elseif (is_single() && get_post_type() == 'sensei_message') { |
|
| 209 | 209 | |
| 210 | 210 | // possible backward compatible template include if theme overrides content-single-message.php |
| 211 | 211 | // this template was removed in 1.9.0 and code all moved into the main single-message.php file |
| 212 | - self::locate_and_load_template_overrides( Sensei()->template_url . 'content-single-message.php', true ); |
|
| 212 | + self::locate_and_load_template_overrides(Sensei()->template_url.'content-single-message.php', true); |
|
| 213 | 213 | |
| 214 | - $file = 'single-message.php'; |
|
| 214 | + $file = 'single-message.php'; |
|
| 215 | 215 | $find[] = $file; |
| 216 | - $find[] = Sensei()->template_url . $file; |
|
| 216 | + $find[] = Sensei()->template_url.$file; |
|
| 217 | 217 | |
| 218 | - } elseif ( is_post_type_archive( 'course' ) |
|
| 219 | - || is_page( Sensei()->get_page_id( 'courses' ) ) |
|
| 220 | - || is_tax( 'course-category' )) { |
|
| 218 | + } elseif (is_post_type_archive('course') |
|
| 219 | + || is_page(Sensei()->get_page_id('courses')) |
|
| 220 | + || is_tax('course-category')) { |
|
| 221 | 221 | |
| 222 | 222 | // possible backward compatible template include if theme overrides 'taxonomy-course-category' |
| 223 | 223 | // this template was removed in 1.9.0 and replaced by archive-course.php |
| 224 | - self::locate_and_load_template_overrides( Sensei()->template_url . 'taxonomy-course-category.php'); |
|
| 224 | + self::locate_and_load_template_overrides(Sensei()->template_url.'taxonomy-course-category.php'); |
|
| 225 | 225 | |
| 226 | - $file = 'archive-course.php'; |
|
| 226 | + $file = 'archive-course.php'; |
|
| 227 | 227 | $find[] = $file; |
| 228 | - $find[] = Sensei()->template_url . $file; |
|
| 228 | + $find[] = Sensei()->template_url.$file; |
|
| 229 | 229 | |
| 230 | - } elseif ( is_post_type_archive( 'sensei_message' ) ) { |
|
| 230 | + } elseif (is_post_type_archive('sensei_message')) { |
|
| 231 | 231 | |
| 232 | - $file = 'archive-message.php'; |
|
| 232 | + $file = 'archive-message.php'; |
|
| 233 | 233 | $find[] = $file; |
| 234 | - $find[] = Sensei()->template_url . $file; |
|
| 234 | + $find[] = Sensei()->template_url.$file; |
|
| 235 | 235 | |
| 236 | - } elseif( is_tax( 'lesson-tag' ) ) { |
|
| 236 | + } elseif (is_tax('lesson-tag')) { |
|
| 237 | 237 | |
| 238 | 238 | // possible backward compatible template include if theme overrides 'taxonomy-lesson-tag.php' |
| 239 | 239 | // this template was removed in 1.9.0 and replaced by archive-lesson.php |
| 240 | - self::locate_and_load_template_overrides( Sensei()->template_url . 'taxonomy-lesson-tag.php' ); |
|
| 240 | + self::locate_and_load_template_overrides(Sensei()->template_url.'taxonomy-lesson-tag.php'); |
|
| 241 | 241 | |
| 242 | - $file = 'archive-lesson.php'; |
|
| 242 | + $file = 'archive-lesson.php'; |
|
| 243 | 243 | $find[] = $file; |
| 244 | - $find[] = Sensei()->template_url . $file; |
|
| 244 | + $find[] = Sensei()->template_url.$file; |
|
| 245 | 245 | |
| 246 | - } elseif ( isset( $wp_query->query_vars['learner_profile'] ) ) { |
|
| 246 | + } elseif (isset($wp_query->query_vars['learner_profile'])) { |
|
| 247 | 247 | |
| 248 | 248 | // Override for sites with static home page |
| 249 | 249 | $wp_query->is_home = false; |
| 250 | 250 | |
| 251 | - $file = 'learner-profile.php'; |
|
| 251 | + $file = 'learner-profile.php'; |
|
| 252 | 252 | $find[] = $file; |
| 253 | - $find[] = Sensei()->template_url . $file; |
|
| 253 | + $find[] = Sensei()->template_url.$file; |
|
| 254 | 254 | |
| 255 | - } elseif ( isset( $wp_query->query_vars['course_results'] ) ) { |
|
| 255 | + } elseif (isset($wp_query->query_vars['course_results'])) { |
|
| 256 | 256 | |
| 257 | 257 | // Override for sites with static home page |
| 258 | 258 | $wp_query->is_home = false; |
| 259 | 259 | |
| 260 | 260 | $file = 'course-results.php'; |
| 261 | 261 | $find[] = $file; |
| 262 | - $find[] = Sensei()->template_url . $file; |
|
| 262 | + $find[] = Sensei()->template_url.$file; |
|
| 263 | 263 | |
| 264 | - }elseif( is_author() |
|
| 265 | - && Sensei_Teacher::is_a_teacher( get_query_var('author') ) |
|
| 266 | - && ! user_can( get_query_var('author'), 'manage_options' ) ){ |
|
| 264 | + }elseif (is_author() |
|
| 265 | + && Sensei_Teacher::is_a_teacher(get_query_var('author')) |
|
| 266 | + && ! user_can(get_query_var('author'), 'manage_options')) { |
|
| 267 | 267 | |
| 268 | 268 | $file = 'teacher-archive.php'; |
| 269 | 269 | $find[] = $file; |
| 270 | - $find[] = Sensei()->template_url . $file; |
|
| 270 | + $find[] = Sensei()->template_url.$file; |
|
| 271 | 271 | |
| 272 | 272 | } // Load the template file |
| 273 | 273 | |
| 274 | - if ( $file ) { |
|
| 274 | + if ($file) { |
|
| 275 | 275 | |
| 276 | - $template = locate_template( $find ); |
|
| 277 | - if ( ! $template ) $template = Sensei()->plugin_path() . '/templates/' . $file; |
|
| 276 | + $template = locate_template($find); |
|
| 277 | + if ( ! $template) $template = Sensei()->plugin_path().'/templates/'.$file; |
|
| 278 | 278 | |
| 279 | 279 | } // End If Statement |
| 280 | 280 | |
@@ -294,18 +294,18 @@ discard block |
||
| 294 | 294 | * |
| 295 | 295 | * @since 1.9.0 |
| 296 | 296 | */ |
| 297 | - public static function get_no_permission_template( ){ |
|
| 297 | + public static function get_no_permission_template( ) { |
|
| 298 | 298 | |
| 299 | 299 | // possible backward compatible template loading |
| 300 | 300 | // this template was removed in 1.9.0 and code all moved into the no-permissions.php file |
| 301 | - self::locate_and_load_template_overrides( Sensei()->template_url . 'content-no-permissions.php', true ); |
|
| 301 | + self::locate_and_load_template_overrides(Sensei()->template_url.'content-no-permissions.php', true); |
|
| 302 | 302 | |
| 303 | - $file = 'no-permissions.php'; |
|
| 303 | + $file = 'no-permissions.php'; |
|
| 304 | 304 | $find[] = $file; |
| 305 | - $find[] = Sensei()->template_url . $file; |
|
| 305 | + $find[] = Sensei()->template_url.$file; |
|
| 306 | 306 | |
| 307 | - $template = locate_template( $find ); |
|
| 308 | - if ( ! $template ) $template = Sensei()->plugin_path() . '/templates/' . $file; |
|
| 307 | + $template = locate_template($find); |
|
| 308 | + if ( ! $template) $template = Sensei()->plugin_path().'/templates/'.$file; |
|
| 309 | 309 | |
| 310 | 310 | return $template; |
| 311 | 311 | |
@@ -324,20 +324,20 @@ discard block |
||
| 324 | 324 | * @param string $template |
| 325 | 325 | * @param bool $load_header_footer should the file be wrapped in between header and footer? Default: true |
| 326 | 326 | */ |
| 327 | - public static function locate_and_load_template_overrides( $template = '', $load_header_footer = false ){ |
|
| 327 | + public static function locate_and_load_template_overrides($template = '', $load_header_footer = false) { |
|
| 328 | 328 | |
| 329 | - $found_template = locate_template( array( $template ) ); |
|
| 330 | - if( $found_template ){ |
|
| 329 | + $found_template = locate_template(array($template)); |
|
| 330 | + if ($found_template) { |
|
| 331 | 331 | |
| 332 | - if( $load_header_footer ){ |
|
| 332 | + if ($load_header_footer) { |
|
| 333 | 333 | |
| 334 | 334 | get_sensei_header(); |
| 335 | - include( $found_template ); |
|
| 335 | + include($found_template); |
|
| 336 | 336 | get_sensei_footer(); |
| 337 | 337 | |
| 338 | - }else{ |
|
| 338 | + } else { |
|
| 339 | 339 | |
| 340 | - include( $found_template ); |
|
| 340 | + include($found_template); |
|
| 341 | 341 | |
| 342 | 342 | } |
| 343 | 343 | |
@@ -354,9 +354,9 @@ discard block |
||
| 354 | 354 | * |
| 355 | 355 | * @deprecated since 1.9.0 |
| 356 | 356 | */ |
| 357 | - public static function deprecated_archive_course_content_hook(){ |
|
| 357 | + public static function deprecated_archive_course_content_hook() { |
|
| 358 | 358 | |
| 359 | - sensei_do_deprecated_action( 'sensei_course_archive_main_content','1.9.0', 'sensei_loop_course_before' ); |
|
| 359 | + sensei_do_deprecated_action('sensei_course_archive_main_content', '1.9.0', 'sensei_loop_course_before'); |
|
| 360 | 360 | |
| 361 | 361 | }// end deprecated_archive_hook |
| 362 | 362 | |
@@ -366,11 +366,11 @@ discard block |
||
| 366 | 366 | * @since 1.9.0 |
| 367 | 367 | * @param WP_Post $post |
| 368 | 368 | */ |
| 369 | - public static function the_title( $post ){ |
|
| 369 | + public static function the_title($post) { |
|
| 370 | 370 | |
| 371 | 371 | // ID passed in |
| 372 | - if( is_numeric( $post ) ){ |
|
| 373 | - $post = get_post( $post ); |
|
| 372 | + if (is_numeric($post)) { |
|
| 373 | + $post = get_post($post); |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | /** |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | * |
| 381 | 381 | * @param $title_html_tag default is 'h3' |
| 382 | 382 | */ |
| 383 | - $title_html_tag = apply_filters('sensei_the_title_html_tag','h3'); |
|
| 383 | + $title_html_tag = apply_filters('sensei_the_title_html_tag', 'h3'); |
|
| 384 | 384 | |
| 385 | 385 | /** |
| 386 | 386 | * Filter the title classes |
@@ -388,14 +388,14 @@ discard block |
||
| 388 | 388 | * @since 1.9.0 |
| 389 | 389 | * @param string $title_classes defaults to $post_type-title |
| 390 | 390 | */ |
| 391 | - $title_classes = apply_filters('sensei_the_title_classes', $post->post_type . '-title' ); |
|
| 391 | + $title_classes = apply_filters('sensei_the_title_classes', $post->post_type.'-title'); |
|
| 392 | 392 | |
| 393 | - $html= ''; |
|
| 394 | - $html .= '<'. $title_html_tag .' class="'. $title_classes .'" >'; |
|
| 395 | - $html .= '<a href="' . get_permalink( $post->ID ) . '" >'; |
|
| 396 | - $html .= $post->post_title ; |
|
| 393 | + $html = ''; |
|
| 394 | + $html .= '<'.$title_html_tag.' class="'.$title_classes.'" >'; |
|
| 395 | + $html .= '<a href="'.get_permalink($post->ID).'" >'; |
|
| 396 | + $html .= $post->post_title; |
|
| 397 | 397 | $html .= '</a>'; |
| 398 | - $html .= '</'. $title_html_tag. '>'; |
|
| 398 | + $html .= '</'.$title_html_tag.'>'; |
|
| 399 | 399 | echo $html; |
| 400 | 400 | |
| 401 | 401 | }// end the title |
@@ -407,11 +407,11 @@ discard block |
||
| 407 | 407 | * @since 1.9.0 |
| 408 | 408 | * @deprecated 1.9.0 |
| 409 | 409 | */ |
| 410 | - public static function deprecated_single_course_inside_before_hooks(){ |
|
| 410 | + public static function deprecated_single_course_inside_before_hooks() { |
|
| 411 | 411 | |
| 412 | - sensei_do_deprecated_action('sensei_course_image','1.9.0', 'sensei_single_course_content_inside_before', array( get_the_ID()) ); |
|
| 413 | - sensei_do_deprecated_action('sensei_course_single_title','1.9.0', 'sensei_single_course_content_inside_before' ); |
|
| 414 | - sensei_do_deprecated_action('sensei_course_single_meta','1.9.0', 'sensei_single_course_content_inside_before' ); |
|
| 412 | + sensei_do_deprecated_action('sensei_course_image', '1.9.0', 'sensei_single_course_content_inside_before', array(get_the_ID())); |
|
| 413 | + sensei_do_deprecated_action('sensei_course_single_title', '1.9.0', 'sensei_single_course_content_inside_before'); |
|
| 414 | + sensei_do_deprecated_action('sensei_course_single_meta', '1.9.0', 'sensei_single_course_content_inside_before'); |
|
| 415 | 415 | |
| 416 | 416 | }// end deprecated_single_course_inside_before_hooks |
| 417 | 417 | |
@@ -422,9 +422,9 @@ discard block |
||
| 422 | 422 | * @since 1.9.0 |
| 423 | 423 | * @deprecated 1.9.0 |
| 424 | 424 | */ |
| 425 | - public static function deprecate_sensei_course_single_lessons_hook(){ |
|
| 425 | + public static function deprecate_sensei_course_single_lessons_hook() { |
|
| 426 | 426 | |
| 427 | - sensei_do_deprecated_action('sensei_course_single_lessons','1.9.0', 'sensei_single_course_content_inside_after'); |
|
| 427 | + sensei_do_deprecated_action('sensei_course_single_lessons', '1.9.0', 'sensei_single_course_content_inside_after'); |
|
| 428 | 428 | |
| 429 | 429 | }// deprecate_sensei_course_single_lessons_hook |
| 430 | 430 | |
@@ -436,13 +436,13 @@ discard block |
||
| 436 | 436 | * @since 1.9.0 |
| 437 | 437 | * @deprecated 1.9.0 |
| 438 | 438 | */ |
| 439 | - public static function deprecated_single_main_content_hook(){ |
|
| 439 | + public static function deprecated_single_main_content_hook() { |
|
| 440 | 440 | |
| 441 | - if( is_singular( 'course' ) ) { |
|
| 441 | + if (is_singular('course')) { |
|
| 442 | 442 | |
| 443 | 443 | sensei_do_deprecated_action('sensei_single_main_content', '1.9.0', 'sensei_single_course_content_inside_before or sensei_single_course_content_inside_after'); |
| 444 | 444 | |
| 445 | - } elseif( is_singular( 'message' ) ){ |
|
| 445 | + } elseif (is_singular('message')) { |
|
| 446 | 446 | |
| 447 | 447 | sensei_do_deprecated_action('sensei_single_main_content', '1.9.0', 'sensei_single_message_content_inside_before or sensei_single_message_content_inside_after'); |
| 448 | 448 | } |
@@ -454,9 +454,9 @@ discard block |
||
| 454 | 454 | * @since 1.9.0 |
| 455 | 455 | * @deprecated since 1.9.0 |
| 456 | 456 | */ |
| 457 | - public static function deprecate_module_before_hook(){ |
|
| 457 | + public static function deprecate_module_before_hook() { |
|
| 458 | 458 | |
| 459 | - sensei_do_deprecated_action('sensei_modules_page_before', '1.9.0','sensei_single_course_modules_after' ); |
|
| 459 | + sensei_do_deprecated_action('sensei_modules_page_before', '1.9.0', 'sensei_single_course_modules_after'); |
|
| 460 | 460 | |
| 461 | 461 | } |
| 462 | 462 | |
@@ -465,9 +465,9 @@ discard block |
||
| 465 | 465 | * @since 1.9.0 |
| 466 | 466 | * @deprecated since 1.9.0 |
| 467 | 467 | */ |
| 468 | - public static function deprecate_module_after_hook(){ |
|
| 468 | + public static function deprecate_module_after_hook() { |
|
| 469 | 469 | |
| 470 | - sensei_do_deprecated_action('sensei_modules_page_after', '1.9.0','sensei_single_course_modules_after' ); |
|
| 470 | + sensei_do_deprecated_action('sensei_modules_page_after', '1.9.0', 'sensei_single_course_modules_after'); |
|
| 471 | 471 | |
| 472 | 472 | } |
| 473 | 473 | |
@@ -477,11 +477,11 @@ discard block |
||
| 477 | 477 | * @since 1.9.0 |
| 478 | 478 | * @deprecated since 1.9.0 |
| 479 | 479 | */ |
| 480 | - public static function deprecate_all_post_type_single_title_hooks(){ |
|
| 480 | + public static function deprecate_all_post_type_single_title_hooks() { |
|
| 481 | 481 | |
| 482 | - if( is_singular( 'sensei_message' ) ){ |
|
| 482 | + if (is_singular('sensei_message')) { |
|
| 483 | 483 | |
| 484 | - sensei_do_deprecated_action( 'sensei_message_single_title', '1.9.0', 'sensei_single_message_content_inside_before' ); |
|
| 484 | + sensei_do_deprecated_action('sensei_message_single_title', '1.9.0', 'sensei_single_message_content_inside_before'); |
|
| 485 | 485 | |
| 486 | 486 | } |
| 487 | 487 | |
@@ -497,10 +497,10 @@ discard block |
||
| 497 | 497 | public static function deprecate_course_single_meta_hooks() { |
| 498 | 498 | |
| 499 | 499 | // deprecate all these hooks |
| 500 | - sensei_do_deprecated_action('sensei_course_start','1.9.0', 'sensei_single_course_content_inside_before' ); |
|
| 501 | - sensei_do_deprecated_action('sensei_woocommerce_in_cart_message','1.9.0', 'sensei_single_course_content_inside_before' ); |
|
| 502 | - sensei_do_deprecated_action('sensei_course_meta','1.9.0', 'sensei_single_course_content_inside_before' ); |
|
| 503 | - sensei_do_deprecated_action('sensei_course_meta_video','1.9.0', 'sensei_single_course_content_inside_before' ); |
|
| 500 | + sensei_do_deprecated_action('sensei_course_start', '1.9.0', 'sensei_single_course_content_inside_before'); |
|
| 501 | + sensei_do_deprecated_action('sensei_woocommerce_in_cart_message', '1.9.0', 'sensei_single_course_content_inside_before'); |
|
| 502 | + sensei_do_deprecated_action('sensei_course_meta', '1.9.0', 'sensei_single_course_content_inside_before'); |
|
| 503 | + sensei_do_deprecated_action('sensei_course_meta_video', '1.9.0', 'sensei_single_course_content_inside_before'); |
|
| 504 | 504 | |
| 505 | 505 | } // End deprecate_course_single_meta_hooks |
| 506 | 506 | |
@@ -510,10 +510,10 @@ discard block |
||
| 510 | 510 | */ |
| 511 | 511 | public static function deprecate_single_lesson_breadcrumbs_and_comments_hooks() { |
| 512 | 512 | |
| 513 | - if( is_singular( 'lesson' ) ){ |
|
| 513 | + if (is_singular('lesson')) { |
|
| 514 | 514 | |
| 515 | - sensei_do_deprecated_action( 'sensei_breadcrumb','1.9.0','sensei_after_main_content', get_the_ID() ); |
|
| 516 | - sensei_do_deprecated_action( 'sensei_comments','1.9.0','sensei_after_main_content', get_the_ID() ); |
|
| 515 | + sensei_do_deprecated_action('sensei_breadcrumb', '1.9.0', 'sensei_after_main_content', get_the_ID()); |
|
| 516 | + sensei_do_deprecated_action('sensei_comments', '1.9.0', 'sensei_after_main_content', get_the_ID()); |
|
| 517 | 517 | |
| 518 | 518 | } |
| 519 | 519 | |
@@ -527,14 +527,14 @@ discard block |
||
| 527 | 527 | * |
| 528 | 528 | * @deprecated since 1.9.0 |
| 529 | 529 | */ |
| 530 | - public static function deprecate_sensei_lesson_course_signup_hook(){ |
|
| 530 | + public static function deprecate_sensei_lesson_course_signup_hook() { |
|
| 531 | 531 | |
| 532 | - $lesson_course_id = get_post_meta( get_the_ID(), '_lesson_course', true ); |
|
| 533 | - $user_taking_course = Sensei_Utils::user_started_course( $lesson_course_id, get_current_user_id() ); |
|
| 532 | + $lesson_course_id = get_post_meta(get_the_ID(), '_lesson_course', true); |
|
| 533 | + $user_taking_course = Sensei_Utils::user_started_course($lesson_course_id, get_current_user_id()); |
|
| 534 | 534 | |
| 535 | - if( !$user_taking_course ) { |
|
| 535 | + if ( ! $user_taking_course) { |
|
| 536 | 536 | |
| 537 | - sensei_do_deprecated_action( 'sensei_lesson_course_signup','1.9.0', 'sensei_single_lesson_content_inside_after', $lesson_course_id ); |
|
| 537 | + sensei_do_deprecated_action('sensei_lesson_course_signup', '1.9.0', 'sensei_single_lesson_content_inside_after', $lesson_course_id); |
|
| 538 | 538 | |
| 539 | 539 | } |
| 540 | 540 | }// end deprecate_sensei_lesson_course_signup_hook |
@@ -545,11 +545,11 @@ discard block |
||
| 545 | 545 | * @since 1.9.0 |
| 546 | 546 | * @deprecated since 1.9.0 |
| 547 | 547 | */ |
| 548 | - public static function deprecate_sensei_lesson_single_meta_hook(){ |
|
| 548 | + public static function deprecate_sensei_lesson_single_meta_hook() { |
|
| 549 | 549 | |
| 550 | - if ( sensei_can_user_view_lesson() ) { |
|
| 550 | + if (sensei_can_user_view_lesson()) { |
|
| 551 | 551 | |
| 552 | - sensei_do_deprecated_action( 'sensei_lesson_single_meta', '1.9.0', 'sensei_single_lesson_content_inside_after' ); |
|
| 552 | + sensei_do_deprecated_action('sensei_lesson_single_meta', '1.9.0', 'sensei_single_lesson_content_inside_after'); |
|
| 553 | 553 | |
| 554 | 554 | |
| 555 | 555 | } |
@@ -560,9 +560,9 @@ discard block |
||
| 560 | 560 | * Deprecate the sensei lesson single title hook |
| 561 | 561 | * @deprecated since 1.9.0 |
| 562 | 562 | */ |
| 563 | - public static function deprecate_sensei_lesson_single_title(){ |
|
| 563 | + public static function deprecate_sensei_lesson_single_title() { |
|
| 564 | 564 | |
| 565 | - sensei_do_deprecated_action( 'sensei_lesson_single_title', '1.9.0', 'sensei_single_lesson_content_inside_before', get_the_ID() ); |
|
| 565 | + sensei_do_deprecated_action('sensei_lesson_single_title', '1.9.0', 'sensei_single_lesson_content_inside_before', get_the_ID()); |
|
| 566 | 566 | |
| 567 | 567 | }// end deprecate_sensei_lesson_single_title |
| 568 | 568 | |
@@ -570,9 +570,9 @@ discard block |
||
| 570 | 570 | * hook in the deperecated single main content to the lesson |
| 571 | 571 | * @deprecated since 1.9.0 |
| 572 | 572 | */ |
| 573 | - public static function deprecate_lesson_single_main_content_hook(){ |
|
| 573 | + public static function deprecate_lesson_single_main_content_hook() { |
|
| 574 | 574 | |
| 575 | - sensei_do_deprecated_action( 'sensei_single_main_content', '1.9.0', 'sensei_single_lesson_content_inside_before' ); |
|
| 575 | + sensei_do_deprecated_action('sensei_single_main_content', '1.9.0', 'sensei_single_lesson_content_inside_before'); |
|
| 576 | 576 | |
| 577 | 577 | }// end sensei_deprecate_lesson_single_main_content_hook |
| 578 | 578 | |
@@ -580,9 +580,9 @@ discard block |
||
| 580 | 580 | * hook in the deperecated single main content to the lesson |
| 581 | 581 | * @deprecated since 1.9.0 |
| 582 | 582 | */ |
| 583 | - public static function deprecate_lesson_image_hook(){ |
|
| 583 | + public static function deprecate_lesson_image_hook() { |
|
| 584 | 584 | |
| 585 | - sensei_do_deprecated_action( 'sensei_lesson_image', '1.9.0', 'sensei_single_lesson_content_inside_before', get_the_ID() ); |
|
| 585 | + sensei_do_deprecated_action('sensei_lesson_image', '1.9.0', 'sensei_single_lesson_content_inside_before', get_the_ID()); |
|
| 586 | 586 | |
| 587 | 587 | }// end sensei_deprecate_lesson_single_main_content_hook |
| 588 | 588 | |
@@ -593,9 +593,9 @@ discard block |
||
| 593 | 593 | * @since 1.9.0 |
| 594 | 594 | * @deprecated since 1.9.0 |
| 595 | 595 | */ |
| 596 | - public static function deprecate_sensei_login_form_hook(){ |
|
| 596 | + public static function deprecate_sensei_login_form_hook() { |
|
| 597 | 597 | |
| 598 | - sensei_do_deprecated_action( 'sensei_login_form', '1.9.0', 'sensei_login_form_before' ); |
|
| 598 | + sensei_do_deprecated_action('sensei_login_form', '1.9.0', 'sensei_login_form_before'); |
|
| 599 | 599 | |
| 600 | 600 | } // end deprecate_sensei_login_form_hook |
| 601 | 601 | |
@@ -608,9 +608,9 @@ discard block |
||
| 608 | 608 | * |
| 609 | 609 | * @since 1.9.0 |
| 610 | 610 | */ |
| 611 | - public static function fire_sensei_complete_course_hook(){ |
|
| 611 | + public static function fire_sensei_complete_course_hook() { |
|
| 612 | 612 | |
| 613 | - do_action( 'sensei_complete_course' ); |
|
| 613 | + do_action('sensei_complete_course'); |
|
| 614 | 614 | |
| 615 | 615 | } //fire_sensei_complete_course_hook |
| 616 | 616 | |
@@ -619,9 +619,9 @@ discard block |
||
| 619 | 619 | * |
| 620 | 620 | * @since 1.9.0 |
| 621 | 621 | */ |
| 622 | - public static function fire_frontend_messages_hook(){ |
|
| 622 | + public static function fire_frontend_messages_hook() { |
|
| 623 | 623 | |
| 624 | - do_action( 'sensei_frontend_messages' ); |
|
| 624 | + do_action('sensei_frontend_messages'); |
|
| 625 | 625 | |
| 626 | 626 | }// end sensei_complete_course_action |
| 627 | 627 | |
@@ -631,9 +631,9 @@ discard block |
||
| 631 | 631 | * |
| 632 | 632 | * @deprected since 1.9.0 |
| 633 | 633 | */ |
| 634 | - public static function deprecate_sensei_before_user_course_content_hook(){ |
|
| 634 | + public static function deprecate_sensei_before_user_course_content_hook() { |
|
| 635 | 635 | |
| 636 | - sensei_do_deprecated_action( 'sensei_before_user_course_content','1.9.0', 'sensei_my_courses_content_inside_before' , wp_get_current_user() ); |
|
| 636 | + sensei_do_deprecated_action('sensei_before_user_course_content', '1.9.0', 'sensei_my_courses_content_inside_before', wp_get_current_user()); |
|
| 637 | 637 | |
| 638 | 638 | }// deprecate_sensei_before_user_course_content_hook |
| 639 | 639 | |
@@ -643,9 +643,9 @@ discard block |
||
| 643 | 643 | * |
| 644 | 644 | * @deprected since 1.9.0 |
| 645 | 645 | */ |
| 646 | - public static function deprecate_sensei_after_user_course_content_hook(){ |
|
| 646 | + public static function deprecate_sensei_after_user_course_content_hook() { |
|
| 647 | 647 | |
| 648 | - sensei_do_deprecated_action( 'sensei_after_user_course_content','1.9.0', 'sensei_my_courses_content_inside_after' , wp_get_current_user() ); |
|
| 648 | + sensei_do_deprecated_action('sensei_after_user_course_content', '1.9.0', 'sensei_my_courses_content_inside_after', wp_get_current_user()); |
|
| 649 | 649 | |
| 650 | 650 | }// deprecate_sensei_after_user_course_content_hook |
| 651 | 651 | |
@@ -655,10 +655,10 @@ discard block |
||
| 655 | 655 | * @deprecated since 1.9.0 |
| 656 | 656 | * @since 1.9.0 |
| 657 | 657 | */ |
| 658 | - public static function deprecated_archive_message_hooks (){ |
|
| 658 | + public static function deprecated_archive_message_hooks() { |
|
| 659 | 659 | |
| 660 | - sensei_do_deprecated_action('sensei_message_archive_main_content', '1.9.0', 'sensei_archive_before_message_loop OR sensei_archive_after_message_loop' ); |
|
| 661 | - sensei_do_deprecated_action('sensei_message_archive_header', '1.9.0', 'sensei_archive_before_message_loop' ); |
|
| 660 | + sensei_do_deprecated_action('sensei_message_archive_main_content', '1.9.0', 'sensei_archive_before_message_loop OR sensei_archive_after_message_loop'); |
|
| 661 | + sensei_do_deprecated_action('sensei_message_archive_header', '1.9.0', 'sensei_archive_before_message_loop'); |
|
| 662 | 662 | |
| 663 | 663 | } |
| 664 | 664 | |
@@ -668,9 +668,9 @@ discard block |
||
| 668 | 668 | * |
| 669 | 669 | * @deprecated since 1.9.0 |
| 670 | 670 | */ |
| 671 | - public static function deprecate_sensei_complete_quiz_action(){ |
|
| 671 | + public static function deprecate_sensei_complete_quiz_action() { |
|
| 672 | 672 | |
| 673 | - sensei_do_deprecated_action( 'sensei_complete_quiz', '1.9.0', 'sensei_single_quiz_content_inside_before' ); |
|
| 673 | + sensei_do_deprecated_action('sensei_complete_quiz', '1.9.0', 'sensei_single_quiz_content_inside_before'); |
|
| 674 | 674 | |
| 675 | 675 | } |
| 676 | 676 | |
@@ -680,7 +680,7 @@ discard block |
||
| 680 | 680 | * |
| 681 | 681 | * @deprecated since 1.9.0 |
| 682 | 682 | */ |
| 683 | - public static function deprecate_sensei_quiz_question_type_action(){ |
|
| 683 | + public static function deprecate_sensei_quiz_question_type_action() { |
|
| 684 | 684 | |
| 685 | 685 | // Question Type |
| 686 | 686 | global $sensei_question_loop; |
@@ -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 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * @hooked WooThemes_Sensei_Messages::the_title - 20 |
| 27 | 27 | * @hooked WooThemes_Sensei_Messages::the_message_sent_by_title - 40 |
| 28 | 28 | */ |
| 29 | - do_action( 'sensei_single_message_content_inside_before', get_the_ID()); |
|
| 29 | + do_action('sensei_single_message_content_inside_before', get_the_ID()); |
|
| 30 | 30 | ?> |
| 31 | 31 | |
| 32 | 32 | <section class="entry"> |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * |
| 44 | 44 | * @param integer $message_id |
| 45 | 45 | */ |
| 46 | - do_action( 'sensei_single_message_content_inside_after', get_the_ID()); |
|
| 46 | + do_action('sensei_single_message_content_inside_after', get_the_ID()); |
|
| 47 | 47 | |
| 48 | 48 | ?> |
| 49 | 49 | </article><!-- .post --> |
@@ -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 integer $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 | * @param integer $quiz_id |
| 133 | 133 | * |
| 134 | 134 | */ |
| 135 | - do_action( 'sensei_single_quiz_content_inside_after', get_the_ID() ); |
|
| 135 | + do_action('sensei_single_quiz_content_inside_after', get_the_ID()); |
|
| 136 | 136 | |
| 137 | 137 | ?> |
| 138 | 138 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 2 | +if ( ! defined('ABSPATH')) exit; |
|
| 3 | 3 | /** |
| 4 | 4 | * Content-course.php template file |
| 5 | 5 | * |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | ?> |
| 16 | 16 | |
| 17 | -<li <?php post_class( WooThemes_Sensei_Course::get_course_loop_content_class() ); ?> > |
|
| 17 | +<li <?php post_class(WooThemes_Sensei_Course::get_course_loop_content_class()); ?> > |
|
| 18 | 18 | |
| 19 | 19 | <?php |
| 20 | 20 | /** |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * |
| 26 | 26 | * @param integer $course_id |
| 27 | 27 | */ |
| 28 | - do_action( 'sensei_course_content_before', get_the_ID() ); |
|
| 28 | + do_action('sensei_course_content_before', get_the_ID()); |
|
| 29 | 29 | ?> |
| 30 | 30 | |
| 31 | 31 | <section class="course-content"> |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * @hooked Sensei()->course->course_image - 10 |
| 45 | 45 | * @hooked Sensei()->course->the_course_meta - 20 |
| 46 | 46 | */ |
| 47 | - do_action('sensei_course_content_inside_before', get_the_ID() ); |
|
| 47 | + do_action('sensei_course_content_inside_before', get_the_ID()); |
|
| 48 | 48 | ?> |
| 49 | 49 | |
| 50 | 50 | <p class="course-excerpt"> |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * @hooked Sensei()->course->the_course_free_lesson_preview - 20 |
| 65 | 65 | */ |
| 66 | - do_action('sensei_course_content_inside_after', get_the_ID() ); |
|
| 66 | + do_action('sensei_course_content_inside_after', get_the_ID()); |
|
| 67 | 67 | ?> |
| 68 | 68 | |
| 69 | 69 | </section> <!-- section .entry --> |
@@ -80,8 +80,8 @@ discard block |
||
| 80 | 80 | * |
| 81 | 81 | * @hooked Sensei()->course->the_course_free_lesson_preview - 20 |
| 82 | 82 | */ |
| 83 | - do_action('sensei_course_content_after', get_the_ID() ); |
|
| 83 | + do_action('sensei_course_content_after', get_the_ID()); |
|
| 84 | 84 | ?> |
| 85 | 85 | |
| 86 | 86 | |
| 87 | -</li> <!-- article .(<?php esc_attr_e( join( ' ', get_post_class( array( 'course', 'post' ) ) ) ); ?> --> |
|
| 88 | 87 | \ No newline at end of file |
| 88 | +</li> <!-- article .(<?php esc_attr_e(join(' ', get_post_class(array('course', 'post')))); ?> --> |
|
| 89 | 89 | \ No newline at end of file |
@@ -11,11 +11,11 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | ?> |
| 13 | 13 | |
| 14 | -<?php get_sensei_header(); ?> |
|
| 14 | +<?php get_sensei_header(); ?> |
|
| 15 | 15 | |
| 16 | 16 | <?php the_post(); ?> |
| 17 | 17 | |
| 18 | -<article <?php post_class( array( 'lesson', 'post' ) ); ?>> |
|
| 18 | +<article <?php post_class(array('lesson', 'post')); ?>> |
|
| 19 | 19 | |
| 20 | 20 | <?php |
| 21 | 21 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * @hooked Sensei_Lesson::lesson_image() - 17 |
| 32 | 32 | * @hooked deprecate_lesson_single_main_content_hook - 20 |
| 33 | 33 | */ |
| 34 | - do_action( 'sensei_single_lesson_content_inside_before', get_the_ID() ); |
|
| 34 | + do_action('sensei_single_lesson_content_inside_before', get_the_ID()); |
|
| 35 | 35 | |
| 36 | 36 | ?> |
| 37 | 37 | |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | <?php |
| 41 | 41 | |
| 42 | - if ( sensei_can_user_view_lesson() ) { |
|
| 42 | + if (sensei_can_user_view_lesson()) { |
|
| 43 | 43 | |
| 44 | - if( apply_filters( 'sensei_video_position', 'top', $post->ID ) == 'top' ) { |
|
| 44 | + if (apply_filters('sensei_video_position', 'top', $post->ID) == 'top') { |
|
| 45 | 45 | |
| 46 | - do_action( 'sensei_lesson_video', $post->ID ); |
|
| 46 | + do_action('sensei_lesson_video', $post->ID); |
|
| 47 | 47 | |
| 48 | 48 | } |
| 49 | 49 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * |
| 73 | 73 | * @hooked Sensei()->frontend->sensei_breadcrumb - 30 |
| 74 | 74 | */ |
| 75 | - do_action( 'sensei_single_lesson_content_inside_after', get_the_ID() ); |
|
| 75 | + do_action('sensei_single_lesson_content_inside_after', get_the_ID()); |
|
| 76 | 76 | |
| 77 | 77 | ?> |
| 78 | 78 | |