Completed
Branch v1.6.0 (7bff6e)
by Sébastien
01:27
created
includes/admin/settings/class-alnp-settings-theme-selectors.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly.
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
18
-if ( ! class_exists( 'ALNP_Settings_Theme_Selectors' ) ) {
18
+if ( ! class_exists('ALNP_Settings_Theme_Selectors')) {
19 19
 
20 20
 	class ALNP_Settings_Theme_Selectors extends ALNP_Settings_Page {
21 21
 
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 		 */
29 29
 		public function __construct() {
30 30
 			$this->id    = 'theme-selectors';
31
-			$this->label = esc_html__( 'Theme Selectors', 'auto-load-next-post' );
31
+			$this->label = esc_html__('Theme Selectors', 'auto-load-next-post');
32 32
 
33 33
 			parent::__construct();
34 34
 
35
-			add_action( 'auto_load_next_post_settings_theme-selectors', array( __CLASS__, 'is_theme_supported' ), 0 );
36
-			add_action( 'auto_load_next_post_settings_theme-selectors', array( __CLASS__, 'no_theme_selectors_set' ), 0 );
35
+			add_action('auto_load_next_post_settings_theme-selectors', array(__CLASS__, 'is_theme_supported'), 0);
36
+			add_action('auto_load_next_post_settings_theme-selectors', array(__CLASS__, 'no_theme_selectors_set'), 0);
37 37
 		} // END __construct()
38 38
 
39 39
 		/**
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
 		 * @since  1.5.10
45 45
 		 */
46 46
 		public static function is_theme_supported() {
47
-			if ( is_alnp_supported() ) {
48
-				$plugin_supported = alnp_get_theme_support( 'plugin_support' );
47
+			if (is_alnp_supported()) {
48
+				$plugin_supported = alnp_get_theme_support('plugin_support');
49 49
 
50 50
 				// Is the theme supported by theme or plugin?
51
-				if ( ! empty( $plugin_supported ) && $plugin_supported == 'yes' ) {
52
-					include( dirname( AUTO_LOAD_NEXT_POST_FILE ) . '/includes/admin/views/html-notice-plugin-supported.php' );
51
+				if ( ! empty($plugin_supported) && $plugin_supported == 'yes') {
52
+					include(dirname(AUTO_LOAD_NEXT_POST_FILE).'/includes/admin/views/html-notice-plugin-supported.php');
53 53
 				} else {
54
-					include( dirname( AUTO_LOAD_NEXT_POST_FILE ) . '/includes/admin/views/html-notice-is-supported.php' );
54
+					include(dirname(AUTO_LOAD_NEXT_POST_FILE).'/includes/admin/views/html-notice-is-supported.php');
55 55
 				}
56 56
 			}
57 57
 		} // END is_theme_supported()
@@ -66,24 +66,24 @@  discard block
 block discarded – undo
66 66
 		public static function no_theme_selectors_set() {
67 67
 			$set_selectors = array();
68 68
 
69
-			$content_container    = get_option( 'auto_load_next_post_content_container' );
70
-			$title_selector       = get_option( 'auto_load_next_post_title_selector' );
71
-			$navigation_container = get_option( 'auto_load_next_post_navigation_container' );
69
+			$content_container    = get_option('auto_load_next_post_content_container');
70
+			$title_selector       = get_option('auto_load_next_post_title_selector');
71
+			$navigation_container = get_option('auto_load_next_post_navigation_container');
72 72
 
73
-			if ( ! empty( $content_container ) ) {
73
+			if ( ! empty($content_container)) {
74 74
 				$set_selectors[] = $content_container;
75 75
 			}
76 76
 
77
-			if ( ! empty( $title_selector ) ) {
77
+			if ( ! empty($title_selector)) {
78 78
 				$set_selectors[] = $title_selector;
79 79
 			}
80 80
 
81
-			if ( ! empty( $navigation_container ) ) {
81
+			if ( ! empty($navigation_container)) {
82 82
 				$set_selectors[] = $navigation_container;
83 83
 			}
84 84
 
85
-			if ( empty( $set_selectors ) || is_array( $set_selectors ) && count( $set_selectors ) < 3 ) {
86
-				include( dirname( AUTO_LOAD_NEXT_POST_FILE ) . '/includes/admin/views/html-notice-no-theme-selectors.php' );
85
+			if (empty($set_selectors) || is_array($set_selectors) && count($set_selectors) < 3) {
86
+				include(dirname(AUTO_LOAD_NEXT_POST_FILE).'/includes/admin/views/html-notice-no-theme-selectors.php');
87 87
 			}
88 88
 		} // END no_theme_selectors_set()
89 89
 
@@ -102,27 +102,27 @@  discard block
 block discarded – undo
102 102
 			$settings = array();
103 103
 
104 104
 			$settings[] = array(
105
-				'title' => esc_html__( 'Theme Selectors', 'auto-load-next-post' ),
105
+				'title' => esc_html__('Theme Selectors', 'auto-load-next-post'),
106 106
 				'type'  => 'title',
107
-				'desc'  => sprintf( esc_html__( 'Here you set the theme selectors below according to your active theme. All are required for %s to work.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ),
107
+				'desc'  => sprintf(esc_html__('Here you set the theme selectors below according to your active theme. All are required for %s to work.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')),
108 108
 				'id'    => 'theme_selectors_options'
109 109
 			);
110 110
 
111 111
 			// Provide the theme customizer option if theme is not already supported.
112
-			if ( ! is_alnp_supported() ) {
112
+			if ( ! is_alnp_supported()) {
113 113
 				$query = array(
114 114
 					'autofocus[panel]'   => 'alnp',
115 115
 					'autofocus[section]' => 'auto_load_next_post_theme_selectors',
116 116
 					'url'                => alnp_get_random_page_permalink(),
117
-					'return'             => add_query_arg( array( 'page' => 'auto-load-next-post', 'view' => 'theme-selectors' ), admin_url( 'options-general.php' ) ),
117
+					'return'             => add_query_arg(array('page' => 'auto-load-next-post', 'view' => 'theme-selectors'), admin_url('options-general.php')),
118 118
 				);
119
-				$customizer_link = add_query_arg( $query, admin_url( 'customize.php' ) );
119
+				$customizer_link = add_query_arg($query, admin_url('customize.php'));
120 120
 
121 121
 				$settings[] = array(
122
-					'title'   => esc_html__( 'Theme Customizer', 'auto-load-next-post' ),
123
-					'desc'    => esc_html__( 'Use the theme customizer to enter the theme selectors while you inspect the theme.', 'auto-load-next-post' ),
122
+					'title'   => esc_html__('Theme Customizer', 'auto-load-next-post'),
123
+					'desc'    => esc_html__('Use the theme customizer to enter the theme selectors while you inspect the theme.', 'auto-load-next-post'),
124 124
 					'id'      => 'auto_load_next_post_customizer',
125
-					'value'   => esc_html__( 'Open Theme Customizer', 'auto-load-next-post' ),
125
+					'value'   => esc_html__('Open Theme Customizer', 'auto-load-next-post'),
126 126
 					'url'     => $customizer_link,
127 127
 					'type'    => 'button'
128 128
 				);
@@ -141,18 +141,18 @@  discard block
 block discarded – undo
141 141
 			$comments_container_default = '';
142 142
 
143 143
 			// Checks if the Content Container selector has been set by theme support.
144
-			if ( ! empty( alnp_get_theme_support( 'content_container' ) ) ) {
144
+			if ( ! empty(alnp_get_theme_support('content_container'))) {
145 145
 				$container_readonly = 'yes';
146 146
 			} else {
147
-				$container_default = sprintf( __( 'Default: %s', 'auto-load-next-post' ), '<code>main.site-main</code>' );
147
+				$container_default = sprintf(__('Default: %s', 'auto-load-next-post'), '<code>main.site-main</code>');
148 148
 			}
149 149
 
150 150
 			$settings[] = array(
151
-				'title'       => esc_html__( 'Content Container', 'auto-load-next-post' ),
152
-				'desc'        => sprintf( __( 'The primary container where the post content is loaded in. %s', 'auto-load-next-post' ), $container_default ),
151
+				'title'       => esc_html__('Content Container', 'auto-load-next-post'),
152
+				'desc'        => sprintf(__('The primary container where the post content is loaded in. %s', 'auto-load-next-post'), $container_default),
153 153
 				'id'          => 'auto_load_next_post_content_container',
154 154
 				'default'     => 'main.site-main',
155
-				'placeholder' => sprintf( esc_html__( 'e.g. %s', 'auto-load-next-post' ), 'main.site-main' ),
155
+				'placeholder' => sprintf(esc_html__('e.g. %s', 'auto-load-next-post'), 'main.site-main'),
156 156
 				'readonly'    => $container_readonly,
157 157
 				'type'        => 'text',
158 158
 				'css'         => 'min-width:300px;',
@@ -161,18 +161,18 @@  discard block
 block discarded – undo
161 161
 			);
162 162
 
163 163
 			// Checks if the Post Title selector has been set by theme support.
164
-			if ( ! empty( alnp_get_theme_support( 'title_selector' ) ) ) {
164
+			if ( ! empty(alnp_get_theme_support('title_selector'))) {
165 165
 				$post_title_readonly = 'yes';
166 166
 			} else {
167
-				$post_title_default = sprintf( __( 'Default: %s', 'auto-load-next-post' ), '<code>h1.entry-title</code>' );
167
+				$post_title_default = sprintf(__('Default: %s', 'auto-load-next-post'), '<code>h1.entry-title</code>');
168 168
 			}
169 169
 
170 170
 			$settings[] = array(
171
-				'title'       => esc_html__( 'Post Title', 'auto-load-next-post' ),
172
-				'desc'        => sprintf( __( 'Used to identify which article the user is reading and track should Google Analytics or other analytics be enabled. %s', 'auto-load-next-post' ), $post_title_default ),
171
+				'title'       => esc_html__('Post Title', 'auto-load-next-post'),
172
+				'desc'        => sprintf(__('Used to identify which article the user is reading and track should Google Analytics or other analytics be enabled. %s', 'auto-load-next-post'), $post_title_default),
173 173
 				'id'          => 'auto_load_next_post_title_selector',
174 174
 				'default'     => 'h1.entry-title',
175
-				'placeholder' => sprintf( esc_html__( 'e.g. %s', 'auto-load-next-post' ), 'h1.entry-title' ),
175
+				'placeholder' => sprintf(esc_html__('e.g. %s', 'auto-load-next-post'), 'h1.entry-title'),
176 176
 				'readonly'    => $post_title_readonly,
177 177
 				'type'        => 'text',
178 178
 				'css'         => 'min-width:300px;',
@@ -181,18 +181,18 @@  discard block
 block discarded – undo
181 181
 			);
182 182
 
183 183
 			// Checks if the Post Navigation selector has been set by theme support.
184
-			if ( ! empty( alnp_get_theme_support( 'navigation_container' ) ) ) {
184
+			if ( ! empty(alnp_get_theme_support('navigation_container'))) {
185 185
 				$post_navigation_readonly = 'yes';
186 186
 			} else {
187
-				$post_navigation_default = sprintf( __( 'Default: %s', 'auto-load-next-post' ), '<code>nav.post-navigation</code>' );
187
+				$post_navigation_default = sprintf(__('Default: %s', 'auto-load-next-post'), '<code>nav.post-navigation</code>');
188 188
 			}
189 189
 
190 190
 			$settings[] = array(
191
-				'title'       => esc_html__( 'Post Navigation', 'auto-load-next-post' ),
192
-				'desc'        => sprintf( __( 'Used to identify which post to load next if any. %s', 'auto-load-next-post' ), $post_navigation_default ),
191
+				'title'       => esc_html__('Post Navigation', 'auto-load-next-post'),
192
+				'desc'        => sprintf(__('Used to identify which post to load next if any. %s', 'auto-load-next-post'), $post_navigation_default),
193 193
 				'id'          => 'auto_load_next_post_navigation_container',
194 194
 				'default'     => 'nav.post-navigation',
195
-				'placeholder' => sprintf( esc_html__( 'e.g. %s', 'auto-load-next-post' ), 'nav.post-navigation' ),
195
+				'placeholder' => sprintf(esc_html__('e.g. %s', 'auto-load-next-post'), 'nav.post-navigation'),
196 196
 				'readonly'    => $post_navigation_readonly,
197 197
 				'type'        => 'text',
198 198
 				'css'         => 'min-width:300px;',
@@ -201,18 +201,18 @@  discard block
 block discarded – undo
201 201
 			);
202 202
 
203 203
 			// Checks if the Comments Container selector has been set by theme support.
204
-			if ( ! empty( alnp_get_theme_support( 'comments_container' ) ) ) {
204
+			if ( ! empty(alnp_get_theme_support('comments_container'))) {
205 205
 				$comments_container_readonly = 'yes';
206 206
 			} else {
207
-				$comments_container_default = sprintf( __( 'Default: %s', 'auto-load-next-post' ), '<code>div#comments</code>' );
207
+				$comments_container_default = sprintf(__('Default: %s', 'auto-load-next-post'), '<code>div#comments</code>');
208 208
 			}
209 209
 
210 210
 			$settings[] = array(
211
-				'title'       => esc_html__( 'Comments Container', 'auto-load-next-post' ),
212
-				'desc'        => sprintf( __( 'Used to remove comments if enabled under %1$sMisc%2$s settings. %3$s', 'auto-load-next-post' ), '<strong><a href="' . add_query_arg( array( 'page' => 'auto-load-next-post', 'view' => 'misc' ), get_admin_url( $blog_id, 'options-general.php' ) ) . '">', '</a></strong>', $comments_container_default ),
211
+				'title'       => esc_html__('Comments Container', 'auto-load-next-post'),
212
+				'desc'        => sprintf(__('Used to remove comments if enabled under %1$sMisc%2$s settings. %3$s', 'auto-load-next-post'), '<strong><a href="'.add_query_arg(array('page' => 'auto-load-next-post', 'view' => 'misc'), get_admin_url($blog_id, 'options-general.php')).'">', '</a></strong>', $comments_container_default),
213 213
 				'id'          => 'auto_load_next_post_comments_container',
214 214
 				'default'     => 'div#comments',
215
-				'placeholder' => sprintf( esc_html__( 'e.g. %s', 'auto-load-next-post' ), 'div#comments' ),
215
+				'placeholder' => sprintf(esc_html__('e.g. %s', 'auto-load-next-post'), 'div#comments'),
216 216
 				'readonly'    => $comments_container_readonly,
217 217
 				'type'        => 'text',
218 218
 				'css'         => 'min-width:300px;',
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 				'id'   => 'theme_selectors_options'
225 225
 			);
226 226
 
227
-			return apply_filters( 'alnp_selectors_settings', $settings );
227
+			return apply_filters('alnp_selectors_settings', $settings);
228 228
 		} // END get_settings()
229 229
 
230 230
 		/**
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 		public function output() {
237 237
 			$settings = $this->get_settings();
238 238
 
239
-			ALNP_Admin_Settings::output_fields( $settings );
239
+			ALNP_Admin_Settings::output_fields($settings);
240 240
 		} // END output()
241 241
 
242 242
 		/**
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 		public function save() {
250 250
 			$settings = $this->get_settings();
251 251
 
252
-			ALNP_Admin_Settings::save_fields( $settings );
252
+			ALNP_Admin_Settings::save_fields($settings);
253 253
 		} // END save()
254 254
 
255 255
 	} // END class
Please login to merge, or discard this patch.
includes/admin/settings/class-alnp-settings-templates.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17
-if ( ! class_exists( 'ALNP_Settings_Templates' ) ) {
17
+if ( ! class_exists('ALNP_Settings_Templates')) {
18 18
 
19 19
 	class ALNP_Settings_Templates extends ALNP_Settings_Page {
20 20
 
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
 		 */
26 26
 		public function __construct() {
27 27
 			$this->id    = 'templates';
28
-			$this->label = esc_html__( 'Templates', 'auto-load-next-post' );
28
+			$this->label = esc_html__('Templates', 'auto-load-next-post');
29 29
 
30 30
 			parent::__construct();
31 31
 
32
-			add_action( 'auto_load_next_post_settings_templates', array( __CLASS__, 'template_location' ), 0 );
32
+			add_action('auto_load_next_post_settings_templates', array(__CLASS__, 'template_location'), 0);
33 33
 		} // END __construct()
34 34
 
35 35
 		/**
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		 * @static
42 42
 		 */
43 43
 		public static function template_location() {
44
-			include( dirname( AUTO_LOAD_NEXT_POST_FILE ) . '/includes/admin/views/html-notice-template-location.php' );
44
+			include(dirname(AUTO_LOAD_NEXT_POST_FILE).'/includes/admin/views/html-notice-template-location.php');
45 45
 		} // END template_location()
46 46
 
47 47
 		/**
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 		public function get_settings() {
54 54
 			$settings = array();
55 55
 
56
-			$description = sprintf( __( 'This helps fine tune %s to locate your theme templates directory in order to display content in the same style as your theme.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) );
56
+			$description = sprintf(__('This helps fine tune %s to locate your theme templates directory in order to display content in the same style as your theme.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post'));
57 57
 
58
-			if ( is_alnp_pro_version_installed() ) {
59
-				$description .= ' ' . sprintf( __( 'Set the location for each post type if they are located in their own template directory. Otherwise just enter the location for %1$sPosts%2$s.', 'auto-load-next-post' ), '<strong>', '</strong>' );
58
+			if (is_alnp_pro_version_installed()) {
59
+				$description .= ' '.sprintf(__('Set the location for each post type if they are located in their own template directory. Otherwise just enter the location for %1$sPosts%2$s.', 'auto-load-next-post'), '<strong>', '</strong>');
60 60
 			}
61 61
 
62 62
 			$settings[] = array(
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
 			$locate_single = alnp_get_template();
70 70
 
71 71
 			// Only show fallback support option if template location was found. May be required should theme structure fail.
72
-			if ( ! empty( $locate_single ) ) {
72
+			if ( ! empty($locate_single)) {
73 73
 				$settings[] = array(
74
-					'title'    => esc_html__( 'Use Fallback?', 'auto-load-next-post' ),
75
-					'desc'     => sprintf( __( 'Enabling this will force the use of fallback support should your active theme not have a great structure. %1$sSee help for more information%2$s.', 'auto-load-next-post' ), '<strong class="red">', '</strong>' ),
74
+					'title'    => esc_html__('Use Fallback?', 'auto-load-next-post'),
75
+					'desc'     => sprintf(__('Enabling this will force the use of fallback support should your active theme not have a great structure. %1$sSee help for more information%2$s.', 'auto-load-next-post'), '<strong class="red">', '</strong>'),
76 76
 					'id'       => 'auto_load_next_post_use_fallback',
77 77
 					'default'  => 'no',
78 78
 					'type'     => 'checkbox',
@@ -80,28 +80,28 @@  discard block
 block discarded – undo
80 80
 				);
81 81
 			}
82 82
 
83
-			foreach( alnp_get_post_types() as $post_type ) {
83
+			foreach (alnp_get_post_types() as $post_type) {
84 84
 				$default  = '';
85 85
 				$readonly = 'no';
86 86
 
87 87
 				// Checks if the filter has been used already and disable posts only if true.
88
-				if ( has_filter( 'alnp_template_location' ) && strtolower( $post_type ) == 'post' ) {
88
+				if (has_filter('alnp_template_location') && strtolower($post_type) == 'post') {
89 89
 					$default  = alnp_template_location();
90 90
 					$readonly = 'yes';
91 91
 				}
92 92
 
93 93
 				// Checks if theme support provided directory location for post and disable posts only if true.
94
-				else if ( ! empty( alnp_get_theme_support( 'directory_post' ) ) && strtolower( $post_type ) == 'post' ) {
95
-					$default  = alnp_get_theme_support( 'directory_post' );
94
+				else if ( ! empty(alnp_get_theme_support('directory_post')) && strtolower($post_type) == 'post') {
95
+					$default  = alnp_get_theme_support('directory_post');
96 96
 					$readonly = 'yes';
97 97
 				}
98 98
 
99 99
 				$settings[] = array(
100
-					'title'       => ucfirst( $post_type ),
101
-					'desc'        => sprintf( __( 'Enter the folder location where the theme template for %s are stored.', 'auto-load-next-post' ), $post_type ),
102
-					'id'          => 'auto_load_next_post_directory_' . strtolower( $post_type ),
100
+					'title'       => ucfirst($post_type),
101
+					'desc'        => sprintf(__('Enter the folder location where the theme template for %s are stored.', 'auto-load-next-post'), $post_type),
102
+					'id'          => 'auto_load_next_post_directory_'.strtolower($post_type),
103 103
 					'default'     => $default,
104
-					'placeholder' => sprintf( esc_html__( 'e.g. %s', 'auto-load-next-post' ), 'template-parts/' ),
104
+					'placeholder' => sprintf(esc_html__('e.g. %s', 'auto-load-next-post'), 'template-parts/'),
105 105
 					'readonly'    => $readonly,
106 106
 					'type'        => 'text',
107 107
 					'css'         => 'min-width:300px;',
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 		public function output() {
126 126
 			$settings = $this->get_settings();
127 127
 
128
-			ALNP_Admin_Settings::output_fields( $settings );
128
+			ALNP_Admin_Settings::output_fields($settings);
129 129
 		} // END output()
130 130
 
131 131
 		/**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
 			$settings = $this->get_settings();
141 141
 
142
-			ALNP_Admin_Settings::save_fields( $settings, $current_view );
142
+			ALNP_Admin_Settings::save_fields($settings, $current_view);
143 143
 		} // END save()
144 144
 
145 145
 	} // END class
Please login to merge, or discard this patch.
includes/admin/settings/class-alnp-settings-events.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly.
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
18
-if ( ! class_exists( 'ALNP_Settings_Events' ) ) {
18
+if ( ! class_exists('ALNP_Settings_Events')) {
19 19
 
20 20
 	class ALNP_Settings_Events extends ALNP_Settings_Page {
21 21
 
@@ -26,11 +26,11 @@  discard block
 block discarded – undo
26 26
 		 */
27 27
 		public function __construct() {
28 28
 			$this->id    = 'events';
29
-			$this->label = esc_html__( 'Events', 'auto-load-next-post' );
29
+			$this->label = esc_html__('Events', 'auto-load-next-post');
30 30
 
31 31
 			parent::__construct();
32 32
 
33
-			add_action( 'auto_load_next_post_settings_events', array( __CLASS__, 'is_jetpack_lazy_images_active' ), 0 );
33
+			add_action('auto_load_next_post_settings_events', array(__CLASS__, 'is_jetpack_lazy_images_active'), 0);
34 34
 		} // END __construct()
35 35
 
36 36
 		/**
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 		 * @static
42 42
 		 */
43 43
 		public static function is_jetpack_lazy_images_active() {
44
-			if ( alnp_check_jetpack() == 'yes' ) {
45
-				if ( Jetpack::is_module_active( 'lazy-images' ) ) {
46
-					include( dirname( AUTO_LOAD_NEXT_POST_FILE ) . '/includes/admin/views/html-notice-jetpack-lazy-images-module.php' );
44
+			if (alnp_check_jetpack() == 'yes') {
45
+				if (Jetpack::is_module_active('lazy-images')) {
46
+					include(dirname(AUTO_LOAD_NEXT_POST_FILE).'/includes/admin/views/html-notice-jetpack-lazy-images-module.php');
47 47
 				}
48 48
 			}
49 49
 		} // END is_jetpack_lazy_images_active()
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
 					array(
62 62
 						'title' => $this->label,
63 63
 						'type'  => 'title',
64
-						'desc'  => sprintf( __( 'Below you can enter external JavaScript events to be triggered alongside %1$s native events. Separate each event like so: %2$s', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), '<code>event1, event2,</code>' ),
64
+						'desc'  => sprintf(__('Below you can enter external JavaScript events to be triggered alongside %1$s native events. Separate each event like so: %2$s', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post'), '<code>event1, event2,</code>'),
65 65
 						'id'    => 'events_options'
66 66
 					),
67 67
 
68 68
 					array(
69
-						'title'    => esc_html__( 'Post loaded', 'auto-load-next-post' ),
70
-						'desc'     => esc_html__( 'Events listed here will be triggered after a new post has loaded.', 'auto-load-next-post' ),
69
+						'title'    => esc_html__('Post loaded', 'auto-load-next-post'),
70
+						'desc'     => esc_html__('Events listed here will be triggered after a new post has loaded.', 'auto-load-next-post'),
71 71
 						'id'       => 'auto_load_next_post_on_load_event',
72 72
 						'default'  => '',
73 73
 						'type'     => 'textarea',
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 					),
77 77
 
78 78
 					array(
79
-						'title'    => esc_html__( 'Entering a Post', 'auto-load-next-post' ),
80
-						'desc'     => esc_html__( 'Events listed here will be triggered when entering a post.', 'auto-load-next-post' ),
79
+						'title'    => esc_html__('Entering a Post', 'auto-load-next-post'),
80
+						'desc'     => esc_html__('Events listed here will be triggered when entering a post.', 'auto-load-next-post'),
81 81
 						'id'       => 'auto_load_next_post_on_entering_event',
82 82
 						'default'  => '',
83 83
 						'type'     => 'textarea',
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		public function output() {
101 101
 			$settings = $this->get_settings();
102 102
 
103
-			ALNP_Admin_Settings::output_fields( $settings );
103
+			ALNP_Admin_Settings::output_fields($settings);
104 104
 		} // END output()
105 105
 
106 106
 		/**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 		public function save() {
112 112
 			$settings = $this->get_settings();
113 113
 
114
-			ALNP_Admin_Settings::save_fields( $settings );
114
+			ALNP_Admin_Settings::save_fields($settings);
115 115
 		} // END save()
116 116
 
117 117
 	} // END class
Please login to merge, or discard this patch.
includes/admin/class-alnp-sidebar.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
19
-if ( ! class_exists( 'ALNP_Sidebar' ) ) {
19
+if ( ! class_exists('ALNP_Sidebar')) {
20 20
 
21 21
 	class ALNP_Sidebar {
22 22
 
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 		 * @access  public
27 27
 		 */
28 28
 		public function __construct() {
29
-			add_action( 'auto_load_next_post_sidebar', array( $this, 'sidebar_top' ), 0 );
30
-			add_action( 'auto_load_next_post_sidebar', array( $this, 'upgrade_details' ), 1 );
31
-			add_action( 'auto_load_next_post_sidebar', array( $this, 'sidebar_bottom' ), 999 );
29
+			add_action('auto_load_next_post_sidebar', array($this, 'sidebar_top'), 0);
30
+			add_action('auto_load_next_post_sidebar', array($this, 'upgrade_details'), 1);
31
+			add_action('auto_load_next_post_sidebar', array($this, 'sidebar_bottom'), 999);
32 32
 		} // END __construct()
33 33
 
34 34
 		/**
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
 		 * @access public
38 38
 		 */
39 39
 		public function sidebar_top() {
40
-			include_once( dirname( __FILE__ ) . '/views/html-admin-sidebar-logo.php' );
40
+			include_once(dirname(__FILE__).'/views/html-admin-sidebar-logo.php');
41 41
 
42
-			do_action( 'auto_load_next_post_sidebar_top' );
42
+			do_action('auto_load_next_post_sidebar_top');
43 43
 		} // END sidebar_top()
44 44
 
45 45
 		/**
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 		 * @access public
50 50
 		 */
51 51
 		public function upgrade_details() {
52
-			if ( ! is_alnp_pro_version_installed() ) {
53
-				include_once( dirname( __FILE__ ) . '/views/html-admin-sidebar.php' );
52
+			if ( ! is_alnp_pro_version_installed()) {
53
+				include_once(dirname(__FILE__).'/views/html-admin-sidebar.php');
54 54
 			}
55 55
 		} // END upgrade_details()
56 56
 
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 		 * @access public
61 61
 		 */
62 62
 		public function sidebar_bottom() {
63
-			do_action( 'auto_load_next_post_sidebar_bottom' );
63
+			do_action('auto_load_next_post_sidebar_bottom');
64 64
 
65
-			include_once( dirname( __FILE__ ) . '/views/html-admin-sidebar-credits.php' );
65
+			include_once(dirname(__FILE__).'/views/html-admin-sidebar-credits.php');
66 66
 		} // END sidebar_bottom()
67 67
 
68 68
 	} // END class
Please login to merge, or discard this patch.
includes/theme-support/class-alnp-oceanwp.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  */
14 14
 
15 15
 // Exit if accessed directly.
16
-if ( ! defined( 'ABSPATH' ) ) {
16
+if ( ! defined('ABSPATH')) {
17 17
 	exit;
18 18
 }
19 19
 
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	public static function init() {
32 32
 		// Add theme support and preset the theme selectors.
33
-		add_action( 'after_setup_theme', array( __CLASS__, 'add_theme_support' ) );
33
+		add_action('after_setup_theme', array(__CLASS__, 'add_theme_support'));
34 34
 
35 35
 		// Filters the location of the repeater template.
36
-		add_filter( 'alnp_template_redirect', array( __CLASS__, 'template_redirect' ) );
36
+		add_filter('alnp_template_redirect', array(__CLASS__, 'template_redirect'));
37 37
 
38 38
 		// Filters the repeater template location.
39 39
 		//add_filter( 'alnp_template_location', array( __CLASS__, 'alnp_oceanwp_template_location' ) );
40 40
 
41 41
 		// Remove Auto Load Next Post compatible post navigation.
42
-		remove_action( 'alnp_load_after_content', 'auto_load_next_post_navigation', 1, 10 );
42
+		remove_action('alnp_load_after_content', 'auto_load_next_post_navigation', 1, 10);
43 43
 	} // END init()
44 44
 
45 45
 	/**
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 * @return string
50 50
 	 */
51 51
 	public static function template_redirect() {
52
-		return AUTO_LOAD_NEXT_POST_FILE_PATH . '/template/theme-support/oceanwp/content-alnp.php';
52
+		return AUTO_LOAD_NEXT_POST_FILE_PATH.'/template/theme-support/oceanwp/content-alnp.php';
53 53
 	} // END template_redirect()
54 54
 
55 55
 	/**
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 * @static
71 71
 	 */
72 72
 	public static function add_theme_support() {
73
-		add_theme_support( 'auto-load-next-post', array(
73
+		add_theme_support('auto-load-next-post', array(
74 74
 			'content_container'    => 'div.site-content',
75 75
 			'title_selector'       => '.entry-title',
76 76
 			'navigation_container' => 'nav.post-navigation',
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 			'load_js_in_footer'    => 'no',
79 79
 			'lock_js_in_footer'    => 'no',
80 80
 			'directory_post'       => 'partials/single/'
81
-		) );
81
+		));
82 82
 	} // END add_theme_support()
83 83
 
84 84
 } // END class
Please login to merge, or discard this patch.
includes/theme-support/class-alnp-poseidon.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  */
14 14
 
15 15
 // Exit if accessed directly.
16
-if ( ! defined( 'ABSPATH' ) ) {
16
+if ( ! defined('ABSPATH')) {
17 17
 	exit;
18 18
 }
19 19
 
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	public static function init() {
32 32
 		// Add theme support and preset the theme selectors.
33
-		add_action( 'after_setup_theme', array( __CLASS__, 'add_theme_support' ) );
33
+		add_action('after_setup_theme', array(__CLASS__, 'add_theme_support'));
34 34
 
35 35
 		// Display the post thumbnail before the content.
36
-		add_action( 'alnp_load_before_content', array( __CLASS__, 'the_post_thumbnail' ), 10 );
36
+		add_action('alnp_load_before_content', array(__CLASS__, 'the_post_thumbnail'), 10);
37 37
 
38 38
 		// Filters the repeater template location.
39 39
 		//add_filter( 'alnp_template_location', array( __CLASS__, 'alnp_poseidon_template_location' ) );
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		// Get theme options from database.
53 53
 		$theme_options = poseidon_theme_options();
54 54
 
55
-		if ( is_single() && has_post_thumbnail() && 'header' == $theme_options['post_layout_single'] ) {
55
+		if (is_single() && has_post_thumbnail() && 'header' == $theme_options['post_layout_single']) {
56 56
 			the_post_thumbnail();
57 57
 		}
58 58
 	} // END the_post_thumbnail()
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 * @version 1.6.0
78 78
 	 */
79 79
 	public static function add_theme_support() {
80
-		add_theme_support( 'auto-load-next-post', array(
80
+		add_theme_support('auto-load-next-post', array(
81 81
 			'content_container'    => 'main.site-main',
82 82
 			'title_selector'       => 'h1.entry-title',
83 83
 			'navigation_container' => 'nav.post-navigation',
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			'load_js_in_footer'    => 'no',
86 86
 			'lock_js_in_footer'    => 'no',
87 87
 			'directory_post'       => 'template-parts/'
88
-		) );
88
+		));
89 89
 	} // END add_theme_support()
90 90
 
91 91
 } // END class
Please login to merge, or discard this patch.
includes/theme-support/class-alnp-understrap.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  */
14 14
 
15 15
 // Exit if accessed directly.
16
-if ( ! defined( 'ABSPATH' ) ) {
16
+if ( ! defined('ABSPATH')) {
17 17
 	exit;
18 18
 }
19 19
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	public static function init() {
32 32
 		// Add theme support and preset the theme selectors.
33
-		add_action( 'after_setup_theme', array( __CLASS__, 'add_theme_support' ) );
33
+		add_action('after_setup_theme', array(__CLASS__, 'add_theme_support'));
34 34
 
35 35
 		// Filters the repeater template location.
36 36
 		//add_filter( 'alnp_template_location', array( __CLASS__, 'alnp_understrap_template_location' ) );
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 * @static
55 55
 	 */
56 56
 	public static function add_theme_support() {
57
-		add_theme_support( 'auto-load-next-post', array(
57
+		add_theme_support('auto-load-next-post', array(
58 58
 			'content_container'    => 'main.site-main',
59 59
 			'title_selector'       => 'h1.entry-title',
60 60
 			'navigation_container' => 'nav.post-navigation',
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 			'load_js_in_footer'    => 'no',
63 63
 			'lock_js_in_footer'    => 'no',
64 64
 			'directory_post'       => 'loop-templates/'
65
-		) );
65
+		));
66 66
 	} // END add_theme_support()
67 67
 
68 68
 } // END class
Please login to merge, or discard this patch.
includes/auto-load-next-post-conditional-functions.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
  */
15 15
 
16 16
 // Exit if accessed directly.
17
-if ( ! defined( 'ABSPATH' ) ) {
17
+if ( ! defined('ABSPATH')) {
18 18
 	exit;
19 19
 }
20 20
 
21
-if ( ! function_exists( 'alnp_template_location' ) ) {
21
+if ( ! function_exists('alnp_template_location')) {
22 22
 	/**
23 23
 	 * Filters the template location for get_template_part().
24 24
 	 *
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	function alnp_template_location() {
30 30
 		$current_theme = get_option('template');
31 31
 
32
-		switch( $current_theme ) {
32
+		switch ($current_theme) {
33 33
 			case 'twentyseventeen':
34 34
 				$path = 'template-parts/post/';
35 35
 				break;
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
 				break;
44 44
 		}
45 45
 
46
-		return apply_filters( 'alnp_template_location', $path );
46
+		return apply_filters('alnp_template_location', $path);
47 47
 	} // END alnp_template_location()
48 48
 }
49 49
 
50
-if ( ! function_exists( 'is_alnp_pro_version_installed' ) ) {
50
+if ( ! function_exists('is_alnp_pro_version_installed')) {
51 51
 	/**
52 52
 	 * Detects if Auto Load Next Post Pro is installed.
53 53
 	 *
@@ -55,17 +55,17 @@  discard block
 block discarded – undo
55 55
 	 * @return boolean
56 56
 	 */
57 57
 	function is_alnp_pro_version_installed() {
58
-		$active_plugins = (array) get_option( 'active_plugins', array() );
58
+		$active_plugins = (array) get_option('active_plugins', array());
59 59
 
60
-		if ( is_multisite() ) {
61
-			$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
60
+		if (is_multisite()) {
61
+			$active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
62 62
 		}
63 63
 
64
-		return in_array( 'auto-load-next-post-pro/auto-load-next-post-pro.php', $active_plugins ) || array_key_exists( 'auto-load-next-post-pro/auto-load-next-post-pro.php', $active_plugins );
64
+		return in_array('auto-load-next-post-pro/auto-load-next-post-pro.php', $active_plugins) || array_key_exists('auto-load-next-post-pro/auto-load-next-post-pro.php', $active_plugins);
65 65
 	} // END is_alnp_pro_version_installed()
66 66
 }
67 67
 
68
-if ( ! function_exists( 'is_alnp_beta' ) ) {
68
+if ( ! function_exists('is_alnp_beta')) {
69 69
 	/**
70 70
 	 * Returns true if Auto Load Next Post is a beta/pre-release.
71 71
 	 *
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	function is_alnp_beta() {
77 77
 		if ( 
78
-			strpos( AUTO_LOAD_NEXT_POST_VERSION, 'beta' ) ||
79
-			strpos( AUTO_LOAD_NEXT_POST_VERSION, 'rc' )
78
+			strpos(AUTO_LOAD_NEXT_POST_VERSION, 'beta') ||
79
+			strpos(AUTO_LOAD_NEXT_POST_VERSION, 'rc')
80 80
 		) {
81 81
 			return true;
82 82
 		}
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	} // END is_alnp_beta()
86 86
 }
87 87
 
88
-if ( ! function_exists( 'is_alnp_active_theme' ) ) {
88
+if ( ! function_exists('is_alnp_active_theme')) {
89 89
 	/**
90 90
 	 * See if theme/s is activate or not.
91 91
 	 *
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
 	 * @param  string|array $theme Theme name or array of theme names to check.
94 94
 	 * @return boolean
95 95
 	 */
96
-	function is_alnp_active_theme( $theme ) {
97
-		return is_array( $theme ) ? in_array( get_template(), $theme, true ) : get_template() === $theme;
96
+	function is_alnp_active_theme($theme) {
97
+		return is_array($theme) ? in_array(get_template(), $theme, true) : get_template() === $theme;
98 98
 	} // END is_alnp_active_theme()
99 99
 }
100 100
 
101
-if ( ! function_exists( 'is_alnp_supported' ) ) {
101
+if ( ! function_exists('is_alnp_supported')) {
102 102
 	/**
103 103
 	 * Returns true if Auto Load Next Post is supported in the theme.
104 104
 	 *
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
 	 * @return boolean
107 107
 	 */
108 108
 	function is_alnp_supported() {
109
-		$theme_support = current_theme_supports( 'auto-load-next-post' );
109
+		$theme_support = current_theme_supports('auto-load-next-post');
110 110
 
111
-		if ( ! $theme_support ) {
111
+		if ( ! $theme_support) {
112 112
 			return false;
113 113
 		}
114 114
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	} // END is_alnp_supported()
117 117
 }
118 118
 
119
-if ( ! function_exists( 'alnp_get_theme_support' ) ) {
119
+if ( ! function_exists('alnp_get_theme_support')) {
120 120
 	/**
121 121
 	 * Return "theme support" values from the current theme, if set.
122 122
 	 *
@@ -125,25 +125,25 @@  discard block
 block discarded – undo
125 125
 	 * @param  mixed  $default Optional value to return if the theme does not declare support for a prop.
126 126
 	 * @return mixed  Value of prop(s).
127 127
 	 */
128
-	function alnp_get_theme_support( $prop = '', $default = null ) {
129
-		$theme_support = get_theme_support( 'auto-load-next-post' );
130
-		$theme_support = is_array( $theme_support ) ? $theme_support[0] : false;
128
+	function alnp_get_theme_support($prop = '', $default = null) {
129
+		$theme_support = get_theme_support('auto-load-next-post');
130
+		$theme_support = is_array($theme_support) ? $theme_support[0] : false;
131 131
 
132
-		if ( ! $theme_support ) {
132
+		if ( ! $theme_support) {
133 133
 			return $default;
134 134
 		}
135 135
 
136
-		if ( ! empty( $prop ) ) {
137
-			$prop_stack = explode( '::', $prop );
138
-			$prop_key   = array_shift( $prop_stack );
136
+		if ( ! empty($prop)) {
137
+			$prop_stack = explode('::', $prop);
138
+			$prop_key   = array_shift($prop_stack);
139 139
 
140
-			if ( isset( $theme_support[ $prop_key ] ) ) {
141
-				$value = $theme_support[ $prop_key ];
140
+			if (isset($theme_support[$prop_key])) {
141
+				$value = $theme_support[$prop_key];
142 142
 
143
-				if ( count( $prop_stack ) ) {
144
-					foreach ( $prop_stack as $prop_key ) {
145
-						if ( is_array( $value ) && isset( $value[ $prop_key ] ) ) {
146
-							$value = $value[ $prop_key ];
143
+				if (count($prop_stack)) {
144
+					foreach ($prop_stack as $prop_key) {
145
+						if (is_array($value) && isset($value[$prop_key])) {
146
+							$value = $value[$prop_key];
147 147
 						} else {
148 148
 							$value = $default;
149 149
 							break;
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	} // END alnp_get_theme_support()
162 162
 }
163 163
 
164
-if ( ! function_exists( 'alnp_is_bot' ) ) {
164
+if ( ! function_exists('alnp_is_bot')) {
165 165
 	/**
166 166
 	 * Was the current request made by a known bot?
167 167
 	 *
@@ -169,13 +169,13 @@  discard block
 block discarded – undo
169 169
 	 * @return boolean
170 170
 	 */
171 171
 	function alnp_is_bot() {
172
-		$is_bot = alnp_is_bot_user_agent( $_SERVER['HTTP_USER_AGENT'] );
172
+		$is_bot = alnp_is_bot_user_agent($_SERVER['HTTP_USER_AGENT']);
173 173
 
174 174
 		return $is_bot;
175 175
 	} // END alnp_is_bot()
176 176
 }
177 177
 
178
-if ( ! function_exists( 'alnp_is_bot_user_agent' ) ) {
178
+if ( ! function_exists('alnp_is_bot_user_agent')) {
179 179
 	/**
180 180
 	 * Is the given user-agent a known bot?
181 181
 	 *
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
 	 * @param  string A user-agent string
184 184
 	 * @return boolean
185 185
 	 */
186
-	function alnp_is_bot_user_agent( $ua = null ) {
187
-		if ( empty( $ua ) ) {
186
+	function alnp_is_bot_user_agent($ua = null) {
187
+		if (empty($ua)) {
188 188
 			return false;
189 189
 		}
190 190
 
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
 			'livelapbot', 'germcrawler', 'domaintunocrawler', 'grapeshotcrawler', 'cloudflare-alwaysonline',
199 199
 		);
200 200
 
201
-		foreach ( $bot_agents as $bot_agent ) {
202
-			if ( false !== stripos( $ua, $bot_agent ) ) {
201
+		foreach ($bot_agents as $bot_agent) {
202
+			if (false !== stripos($ua, $bot_agent)) {
203 203
 				return true;
204 204
 			}
205 205
 		}
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	} // END alnp_is_bot_user_agent()
209 209
 }
210 210
 
211
-if ( ! function_exists( 'alnp_check_jetpack' ) ) {
211
+if ( ! function_exists('alnp_check_jetpack')) {
212 212
 	/**
213 213
 	 * Check if Jetpack is installed.
214 214
 	 *
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	 * @return string
217 217
 	 */
218 218
 	function alnp_check_jetpack() {
219
-		$jetpack_active = class_exists( 'Jetpack' );
219
+		$jetpack_active = class_exists('Jetpack');
220 220
 
221 221
 		$is_active = $jetpack_active ? 'yes' : 'no';
222 222
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	} // END alnp_check_jetpack()
225 225
 }
226 226
 
227
-if ( ! function_exists( 'alnp_airplane_mode_enabled' ) ) {
227
+if ( ! function_exists('alnp_airplane_mode_enabled')) {
228 228
 	/**
229 229
 	 * Check the current status of Airplane Mode.
230 230
 	 *
@@ -233,16 +233,16 @@  discard block
 block discarded – undo
233 233
 	 */
234 234
 	function alnp_airplane_mode_enabled() {
235 235
 		// Bail if CLI.
236
-		if ( defined( 'WP_CLI' ) and WP_CLI ) {
236
+		if (defined('WP_CLI') and WP_CLI) {
237 237
 			return false;
238 238
 		}
239 239
 
240 240
 		// Pull our status from the options table.
241
-		$option = get_site_option( 'airplane-mode' );
241
+		$option = get_site_option('airplane-mode');
242 242
 
243 243
 		// Backup check for regular options table.
244
-		if ( false === $option ) {
245
-			$option = get_option( 'airplane-mode' );
244
+		if (false === $option) {
245
+			$option = get_option('airplane-mode');
246 246
 		}
247 247
 
248 248
 		// Return the option flag.
Please login to merge, or discard this patch.
includes/class-alnp-autoloader.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
  // Exit if accessed directly.
15
- if ( ! defined( 'ABSPATH' ) ) {
15
+ if ( ! defined('ABSPATH')) {
16 16
  	exit;
17 17
  }
18 18
 
19
-if ( ! class_exists( 'ALNP_Autoloader' ) ) {
19
+if ( ! class_exists('ALNP_Autoloader')) {
20 20
 
21 21
 	class ALNP_Autoloader {
22 22
 
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
 		 * The Constructor.
33 33
 		 */
34 34
 		public function __construct() {
35
-			if ( function_exists( '__autoload' ) ) {
36
-				spl_autoload_register( '__autoload' );
35
+			if (function_exists('__autoload')) {
36
+				spl_autoload_register('__autoload');
37 37
 			}
38 38
 
39
-			spl_autoload_register( array( $this, 'autoload' ) );
39
+			spl_autoload_register(array($this, 'autoload'));
40 40
 
41
-			$this->include_path = untrailingslashit( plugin_dir_path( AUTO_LOAD_NEXT_POST_FILE ) ) . '/includes/';
41
+			$this->include_path = untrailingslashit(plugin_dir_path(AUTO_LOAD_NEXT_POST_FILE)).'/includes/';
42 42
 		}
43 43
 
44 44
 		/**
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 		 * @param  string $class Class name.
49 49
 		 * @return string
50 50
 		 */
51
-		private function get_file_name_from_class( $class ) {
52
-			return 'class-' . str_replace( '_', '-', $class ) . '.php';
51
+		private function get_file_name_from_class($class) {
52
+			return 'class-'.str_replace('_', '-', $class).'.php';
53 53
 		} // END get_file_name_from_class()
54 54
 
55 55
 		/**
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
 		 * @param  string $path File path.
60 60
 		 * @return bool Successful or not.
61 61
 		 */
62
-		private function load_file( $path ) {
63
-			if ( $path && is_readable( $path ) ) {
62
+		private function load_file($path) {
63
+			if ($path && is_readable($path)) {
64 64
 				include_once $path;
65 65
 				return true;
66 66
 			}
@@ -73,22 +73,22 @@  discard block
 block discarded – undo
73 73
 		 * @access public
74 74
 		 * @param  string $class Class name.
75 75
 		 */
76
-		public function autoload( $class ) {
77
-			$class = strtolower( $class );
76
+		public function autoload($class) {
77
+			$class = strtolower($class);
78 78
 
79
-			if ( 0 !== strpos( $class, 'alnp_' ) ) {
79
+			if (0 !== strpos($class, 'alnp_')) {
80 80
 				return;
81 81
 			}
82 82
 
83
-			$file = $this->get_file_name_from_class( $class );
83
+			$file = $this->get_file_name_from_class($class);
84 84
 			$path = '';
85 85
 
86
-			if ( 0 === strpos( $class, 'alnp_admin' ) ) {
87
-				$path = $this->include_path . 'admin/';
86
+			if (0 === strpos($class, 'alnp_admin')) {
87
+				$path = $this->include_path.'admin/';
88 88
 			}
89 89
 
90
-			if ( empty( $path ) || ! $this->load_file( $path . $file ) ) {
91
-				$this->load_file( $this->include_path . $file );
90
+			if (empty($path) || ! $this->load_file($path.$file)) {
91
+				$this->load_file($this->include_path.$file);
92 92
 			}
93 93
 		} // END autoload()
94 94
 
Please login to merge, or discard this patch.