Completed
Push — master ( 1874e1...c256b0 )
by Fernando
02:22
created
includes/plugins/sensei.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@  discard block
 block discarded – undo
6 6
  * @subpackage sensei
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13 13
 global $woothemes_sensei;
14 14
 
15
-if ( ! function_exists( 'lsx_sensei_scripts_add_styles' ) ) :
15
+if ( ! function_exists('lsx_sensei_scripts_add_styles')) :
16 16
 
17 17
 	/**
18 18
 	 * Sensei enqueue styles.
@@ -21,15 +21,15 @@  discard block
 block discarded – undo
21 21
 	 * @subpackage sensei
22 22
 	 */
23 23
 	function lsx_sensei_scripts_add_styles() {
24
-		wp_enqueue_style( 'sensei-lsx', get_template_directory_uri() . '/assets/css/sensei.css', array( 'lsx_main' ), LSX_VERSION );
25
-		wp_style_add_data( 'sensei-lsx', 'rtl', 'replace' );
24
+		wp_enqueue_style('sensei-lsx', get_template_directory_uri() . '/assets/css/sensei.css', array('lsx_main'), LSX_VERSION);
25
+		wp_style_add_data('sensei-lsx', 'rtl', 'replace');
26 26
 	}
27 27
 
28
-	add_action( 'wp_enqueue_scripts', 'lsx_sensei_scripts_add_styles' );
28
+	add_action('wp_enqueue_scripts', 'lsx_sensei_scripts_add_styles');
29 29
 
30 30
 endif;
31 31
 
32
-if ( ! function_exists( 'lsx_sensei_theme_wrapper_start' ) ) :
32
+if ( ! function_exists('lsx_sensei_theme_wrapper_start')) :
33 33
 
34 34
 	/**
35 35
 	 * Sensei wrapper start.
@@ -39,18 +39,18 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	function lsx_sensei_theme_wrapper_start() {
41 41
 		lsx_content_wrap_before();
42
-		echo '<div id="primary" class="content-area ' . esc_attr( lsx_main_class() ) . '">';
42
+		echo '<div id="primary" class="content-area ' . esc_attr(lsx_main_class()) . '">';
43 43
 		lsx_content_before();
44 44
 		echo '<main id="main" class="site-main" role="main">';
45 45
 		lsx_content_top();
46 46
 	}
47 47
 
48
-	remove_action( 'sensei_before_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper' ), 10 );
49
-	add_action( 'sensei_before_main_content', 'lsx_sensei_theme_wrapper_start' );
48
+	remove_action('sensei_before_main_content', array($woothemes_sensei->frontend, 'sensei_output_content_wrapper'), 10);
49
+	add_action('sensei_before_main_content', 'lsx_sensei_theme_wrapper_start');
50 50
 
51 51
 endif;
52 52
 
53
-if ( ! function_exists( 'lsx_sensei_theme_wrapper_end' ) ) :
53
+if ( ! function_exists('lsx_sensei_theme_wrapper_end')) :
54 54
 
55 55
 	/**
56 56
 	 * Sensei wrapper end.
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
 		lsx_content_wrap_after();
67 67
 	}
68 68
 
69
-	remove_action( 'sensei_after_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper_end' ), 10 );
70
-	add_action( 'sensei_after_main_content', 'lsx_sensei_theme_wrapper_end' );
69
+	remove_action('sensei_after_main_content', array($woothemes_sensei->frontend, 'sensei_output_content_wrapper_end'), 10);
70
+	add_action('sensei_after_main_content', 'lsx_sensei_theme_wrapper_end');
71 71
 
72 72
 endif;
73 73
 
74
-if ( ! function_exists( 'lsx_sensei_disable_lsx_banner' ) ) :
74
+if ( ! function_exists('lsx_sensei_disable_lsx_banner')) :
75 75
 
76 76
 	/**
77 77
 	 * Disable LSX Banners in some Sensei pages.
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 	 * @package    lsx
80 80
 	 * @subpackage sensei
81 81
 	 */
82
-	function lsx_sensei_disable_lsx_banner( $disabled ) {
83
-		if ( is_sensei() ) {
82
+	function lsx_sensei_disable_lsx_banner($disabled) {
83
+		if (is_sensei()) {
84 84
 			$disabled = true;
85 85
 		}
86 86
 
@@ -88,15 +88,15 @@  discard block
 block discarded – undo
88 88
 	}
89 89
 
90 90
 	// LSX
91
-	add_filter( 'lsx_global_header_disable', 'lsx_sensei_disable_lsx_banner' );
91
+	add_filter('lsx_global_header_disable', 'lsx_sensei_disable_lsx_banner');
92 92
 	// LSX Banners - Plugin, Placeholders
93
-	add_filter( 'lsx_banner_plugin_disable', 'lsx_sensei_disable_lsx_banner' );
93
+	add_filter('lsx_banner_plugin_disable', 'lsx_sensei_disable_lsx_banner');
94 94
 	// LSX Banners - Banner
95
-	add_filter( 'lsx_banner_disable', 'lsx_sensei_disable_lsx_banner' );
95
+	add_filter('lsx_banner_disable', 'lsx_sensei_disable_lsx_banner');
96 96
 
97 97
 endif;
98 98
 
99
-if ( ! function_exists( 'lsx_sensei_archive_title' ) ) :
99
+if ( ! function_exists('lsx_sensei_archive_title')) :
100 100
 
101 101
 	/**
102 102
 	 * Filters the archive title.
@@ -104,17 +104,17 @@  discard block
 block discarded – undo
104 104
 	 * @package    lsx
105 105
 	 * @subpackage sensei
106 106
 	 */
107
-	function lsx_sensei_archive_title( $html ) {
108
-		$html = preg_replace( '/<header class="archive-header"><h1>([^<]+)<\/h1><\/header>/i', '<h1>$1</h1>', $html );
107
+	function lsx_sensei_archive_title($html) {
108
+		$html = preg_replace('/<header class="archive-header"><h1>([^<]+)<\/h1><\/header>/i', '<h1>$1</h1>', $html);
109 109
 		return $html;
110 110
 	}
111 111
 
112
-	add_filter( 'course_archive_title', 'lsx_sensei_archive_title', 10, 1 );
113
-	add_filter( 'sensei_lesson_archive_title', 'lsx_sensei_archive_title', 10, 1 );
112
+	add_filter('course_archive_title', 'lsx_sensei_archive_title', 10, 1);
113
+	add_filter('sensei_lesson_archive_title', 'lsx_sensei_archive_title', 10, 1);
114 114
 
115 115
 endif;
116 116
 
117
-if ( ! function_exists( 'lsx_sensei_category_title' ) ) :
117
+if ( ! function_exists('lsx_sensei_category_title')) :
118 118
 
119 119
 	/**
120 120
 	 * Filters the archive title.
@@ -122,24 +122,24 @@  discard block
 block discarded – undo
122 122
 	 * @package    lsx
123 123
 	 * @subpackage sensei
124 124
 	 */
125
-	function lsx_sensei_category_title( $html ) {
126
-		$html = str_replace( 'h2', 'h1', $html );
125
+	function lsx_sensei_category_title($html) {
126
+		$html = str_replace('h2', 'h1', $html);
127 127
 		return $html;
128 128
 	}
129 129
 
130
-	add_filter( 'course_category_title', 'lsx_sensei_category_title', 10, 1 );
130
+	add_filter('course_category_title', 'lsx_sensei_category_title', 10, 1);
131 131
 
132 132
 endif;
133 133
 
134 134
 // Switching the course filters and the headers around
135
-remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 10, 0 );
136
-remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_sorting' ) );
137
-remove_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_filters' ) );
138
-add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 11, 0 );
139
-add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_sorting' ),12 );
140
-add_action( 'sensei_archive_before_course_loop', array( 'Sensei_Course', 'course_archive_filters' ),12 );
135
+remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 10, 0);
136
+remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting'));
137
+remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters'));
138
+add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 11, 0);
139
+add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting'), 12);
140
+add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters'), 12);
141 141
 
142
-if ( ! function_exists( 'lsx_sensei_add_buttons' ) ) :
142
+if ( ! function_exists('lsx_sensei_add_buttons')) :
143 143
 
144 144
 	/**
145 145
 	 * Add extra buttons to the single view on lists.
@@ -147,27 +147,27 @@  discard block
 block discarded – undo
147 147
 	 * @package    lsx
148 148
 	 * @subpackage sensei
149 149
 	 */
150
-	function lsx_sensei_add_buttons( $course_id ) {
150
+	function lsx_sensei_add_buttons($course_id) {
151 151
 		global $post, $current_user;
152
-		$is_user_taking_course = Sensei_Utils::user_started_course( $post->ID, $current_user->ID );
152
+		$is_user_taking_course = Sensei_Utils::user_started_course($post->ID, $current_user->ID);
153 153
 		?>
154 154
 			<section class="entry-actions">
155
-				<a class="button" href="<?php echo esc_url( tribe_get_event_link() ); ?>"><?php esc_html_e( 'View course', 'lsx' ); ?></a>
155
+				<a class="button" href="<?php echo esc_url(tribe_get_event_link()); ?>"><?php esc_html_e('View course', 'lsx'); ?></a>
156 156
 
157 157
 				<?php
158
-					if ( is_user_logged_in() && ! $is_user_taking_course ) {
159
-						Sensei_WC::the_add_to_cart_button_html( $post->ID );
158
+					if (is_user_logged_in() && ! $is_user_taking_course) {
159
+						Sensei_WC::the_add_to_cart_button_html($post->ID);
160 160
 					}
161 161
 				?>
162 162
 			</section>
163 163
 		<?php
164 164
 	}
165 165
 
166
-	add_action( 'sensei_course_content_inside_after', 'lsx_sensei_add_buttons', 9 );
166
+	add_action('sensei_course_content_inside_after', 'lsx_sensei_add_buttons', 9);
167 167
 
168 168
 endif;
169 169
 
170
-if ( ! function_exists( 'lsx_sensei_add_to_cart_text' ) ) :
170
+if ( ! function_exists('lsx_sensei_add_to_cart_text')) :
171 171
 
172 172
 	/**
173 173
 	 * Change add to cart button text.
@@ -175,12 +175,12 @@  discard block
 block discarded – undo
175 175
 	 * @package    lsx
176 176
 	 * @subpackage sensei
177 177
 	 */
178
-	function lsx_sensei_add_to_cart_text( $text ) {
179
-		$text = esc_html__( 'Add to cart', 'lsx' );
178
+	function lsx_sensei_add_to_cart_text($text) {
179
+		$text = esc_html__('Add to cart', 'lsx');
180 180
 		return $text;
181 181
 	}
182 182
 
183
-	add_filter( 'sensei_wc_single_add_to_cart_button_text', 'lsx_sensei_add_to_cart_text' );
183
+	add_filter('sensei_wc_single_add_to_cart_button_text', 'lsx_sensei_add_to_cart_text');
184 184
 
185 185
 endif;
186 186
 
Please login to merge, or discard this patch.