Completed
Branch master (947840)
by
unknown
01:39
created
includes/theme-support/class-alnp-twenty-fourteen.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  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
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public static function init() {
31 31
 		// Add theme support and preset the theme selectors.
32
-		add_action( 'after_setup_theme', array( __CLASS__, 'add_theme_support' ) );
32
+		add_action('after_setup_theme', array(__CLASS__, 'add_theme_support'));
33 33
 	} // END init()
34 34
 
35 35
 	/**
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 	 * @static
41 41
 	 */
42 42
 	public static function add_theme_support() {
43
-		add_theme_support( 'auto-load-next-post', array(
43
+		add_theme_support('auto-load-next-post', array(
44 44
 			'content_container'    => '.site-content',
45 45
 			'title_selector'       => 'h1.entry-title',
46 46
 			'navigation_container' => 'nav.post-navigation',
47 47
 			'comments_container'   => 'div#comments',
48 48
 			'load_js_in_footer'    => 'no',
49 49
 			'lock_js_in_footer'    => 'no',
50
-		) );
50
+		));
51 51
 	} // END add_theme_support()
52 52
 
53 53
 } // END class
Please login to merge, or discard this patch.
includes/theme-support/class-alnp-understrap.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  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
 
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public static function init() {
31 31
 		// Add theme support and preset the theme selectors.
32
-		add_action( 'after_setup_theme', array( __CLASS__, 'add_theme_support' ) );
32
+		add_action('after_setup_theme', array(__CLASS__, 'add_theme_support'));
33 33
 
34 34
 		// Filters the repeater template location.
35
-		add_filter( 'alnp_template_location', array( __CLASS__, 'alnp_understrap_template_location' ) );
35
+		add_filter('alnp_template_location', array(__CLASS__, 'alnp_understrap_template_location'));
36 36
 	} // END init()
37 37
 
38 38
 	/**
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 	 * @static
54 54
 	 */
55 55
 	public static function add_theme_support() {
56
-		add_theme_support( 'auto-load-next-post', array(
56
+		add_theme_support('auto-load-next-post', array(
57 57
 			'content_container'    => 'main.site-main',
58 58
 			'title_selector'       => 'h1.entry-title',
59 59
 			'navigation_container' => 'nav.post-navigation',
60 60
 			'comments_container'   => 'div#comments',
61 61
 			'load_js_in_footer'    => 'no',
62 62
 			'lock_js_in_footer'    => 'no',
63
-		) );
63
+		));
64 64
 	} // END add_theme_support()
65 65
 
66 66
 } // END class
Please login to merge, or discard this patch.
includes/admin/settings/class-alnp-settings-misc.php 1 patch
Spacing   +33 added lines, -33 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( 'Auto_Load_Next_Post_Settings_Misc_Tab' ) ) {
17
+if ( ! class_exists('Auto_Load_Next_Post_Settings_Misc_Tab')) {
18 18
 
19 19
 	class Auto_Load_Next_Post_Settings_Misc_Tab extends Auto_Load_Next_Post_Settings_Page {
20 20
 
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 		 */
29 29
 		public function __construct() {
30 30
 			$this->id    = 'misc';
31
-			$this->label = esc_html__( 'Misc', 'auto-load-next-post' );
31
+			$this->label = esc_html__('Misc', 'auto-load-next-post');
32 32
 
33 33
 			parent::__construct();
34 34
 
35
-			add_filter( 'auto_load_next_post_' . $this->id . '_settings', array( __CLASS__, 'lock_js_in_footer' ), 0, 1 );
36
-			add_action( 'auto_load_next_post_sections_' . $this->id, array( __CLASS__, 'no_comment_selector_set' ), 10 );
35
+			add_filter('auto_load_next_post_'.$this->id.'_settings', array(__CLASS__, 'lock_js_in_footer'), 0, 1);
36
+			add_action('auto_load_next_post_sections_'.$this->id, array(__CLASS__, 'no_comment_selector_set'), 10);
37 37
 		} // END __construct()
38 38
 
39 39
 		/**
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
 		 * @since  1.5.0
45 45
 		 */
46 46
 		public static function no_comment_selector_set() {
47
-			$comments_container = get_option( 'auto_load_next_post_comments_container' );
48
-			$remove_comments    = get_option( 'auto_load_next_post_remove_comments' );
47
+			$comments_container = get_option('auto_load_next_post_comments_container');
48
+			$remove_comments    = get_option('auto_load_next_post_remove_comments');
49 49
 
50
-			if ( empty( $comments_container ) && ! empty( $remove_comments ) ) {
51
-				include( dirname( AUTO_LOAD_NEXT_POST_FILE ) . '/includes/admin/views/html-notice-no-comment-selector.php' );
50
+			if (empty($comments_container) && ! empty($remove_comments)) {
51
+				include(dirname(AUTO_LOAD_NEXT_POST_FILE).'/includes/admin/views/html-notice-no-comment-selector.php');
52 52
 			}
53 53
 		} // END no_comment_selector_set()
54 54
 
@@ -62,19 +62,19 @@  discard block
 block discarded – undo
62 62
 		 * @param  array $settings
63 63
 		 * @return array $settings
64 64
 		 */
65
-		public static function lock_js_in_footer( $settings ) {
66
-			$js_locked_in_footer = get_option( 'auto_load_next_post_js_footer_locked' );
65
+		public static function lock_js_in_footer($settings) {
66
+			$js_locked_in_footer = get_option('auto_load_next_post_js_footer_locked');
67 67
 
68
-			if ( !empty( $js_locked_in_footer ) && $js_locked_in_footer == 'yes' ) {
68
+			if ( ! empty($js_locked_in_footer) && $js_locked_in_footer == 'yes') {
69 69
 				// Setting key to look for.
70 70
 				$key = 'load_js_in_footer';
71 71
 
72 72
 				// Find the setting.
73
-				$find_setting = array_search( $key, $settings );
73
+				$find_setting = array_search($key, $settings);
74 74
 
75 75
 				// Does the setting exist?
76
-				if ( is_bool( $find_setting ) === true ) {
77
-					unset( $settings[$key] );
76
+				if (is_bool($find_setting) === true) {
77
+					unset($settings[$key]);
78 78
 				}
79 79
 			}
80 80
 
@@ -95,45 +95,45 @@  discard block
 block discarded – undo
95 95
 					'title' => array(
96 96
 						'title' => $this->label,
97 97
 						'type'  => 'title',
98
-						'desc'  => sprintf( esc_html__( 'Here you set if you want to track pageviews, remove comments and load %s javascript in the footer.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ),
98
+						'desc'  => sprintf(esc_html__('Here you set if you want to track pageviews, remove comments and load %s javascript in the footer.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')),
99 99
 						'id'    => 'misc_options'
100 100
 					),
101 101
 
102 102
 					'remove_comments' => array(
103
-						'title'   => esc_html__( 'Remove Comments', 'auto-load-next-post' ),
104
-						'desc'    => esc_html__( 'Enable to remove comments when each post loads including the initial post.', 'auto-load-next-post' ),
103
+						'title'   => esc_html__('Remove Comments', 'auto-load-next-post'),
104
+						'desc'    => esc_html__('Enable to remove comments when each post loads including the initial post.', 'auto-load-next-post'),
105 105
 						'id'      => 'auto_load_next_post_remove_comments',
106 106
 						'default' => 'yes',
107 107
 						'type'    => 'checkbox'
108 108
 					),
109 109
 
110 110
 					'google_analytics' => array(
111
-						'title'   => esc_html__( 'Update Google Analytics', 'auto-load-next-post' ),
112
-						'desc'    => esc_html__( 'Enable to track each post the visitor is reading. This will count as a pageview. You must already have Google Analytics setup.', 'auto-load-next-post' ),
111
+						'title'   => esc_html__('Update Google Analytics', 'auto-load-next-post'),
112
+						'desc'    => esc_html__('Enable to track each post the visitor is reading. This will count as a pageview. You must already have Google Analytics setup.', 'auto-load-next-post'),
113 113
 						'id'      => 'auto_load_next_post_google_analytics',
114 114
 						'default' => 'no',
115 115
 						'type'    => 'checkbox'
116 116
 					),
117 117
 
118 118
 					'load_js_in_footer' => array(
119
-						'title'   => esc_html__( 'JavaScript in Footer?', 'auto-load-next-post' ),
120
-						'desc'    => esc_html__( 'Enable to load Auto Load Next Post in the footer instead of the header. Can be useful to optimize your site or if the current theme requires it.', 'auto-load-next-post' ),
119
+						'title'   => esc_html__('JavaScript in Footer?', 'auto-load-next-post'),
120
+						'desc'    => esc_html__('Enable to load Auto Load Next Post in the footer instead of the header. Can be useful to optimize your site or if the current theme requires it.', 'auto-load-next-post'),
121 121
 						'id'      => 'auto_load_next_post_load_js_in_footer',
122 122
 						'default' => 'no',
123 123
 						'type'    => 'checkbox'
124 124
 					),
125 125
 
126 126
 					'reset_data' => array(
127
-						'title'   => esc_html__( 'Reset all data?', 'auto-load-next-post' ),
128
-						'desc'    => esc_html__( 'Press the reset button to clear all settings for this plugin and re-install the default settings.', 'auto-load-next-post' ),
127
+						'title'   => esc_html__('Reset all data?', 'auto-load-next-post'),
128
+						'desc'    => esc_html__('Press the reset button to clear all settings for this plugin and re-install the default settings.', 'auto-load-next-post'),
129 129
 						'id'      => 'auto_load_next_post_reset_data',
130 130
 						'default' => 'no',
131 131
 						'type'    => 'reset_data'
132 132
 					),
133 133
 
134 134
 					'uninstall' => array(
135
-						'title'   => esc_html__( 'Remove all data on uninstall?', 'auto-load-next-post' ),
136
-						'desc'    => esc_html__( 'If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', 'auto-load-next-post' ),
135
+						'title'   => esc_html__('Remove all data on uninstall?', 'auto-load-next-post'),
136
+						'desc'    => esc_html__('If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', 'auto-load-next-post'),
137 137
 						'id'      => 'auto_load_next_post_uninstall_data',
138 138
 						'default' => 'no',
139 139
 						'type'    => 'checkbox'
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
 		 * @since 1.5.0
154 154
 		 * @param mixed $settings
155 155
 		 */
156
-		public function customize_button( $settings ) {
156
+		public function customize_button($settings) {
157 157
 			?>
158 158
 			<tr valign="top">
159
-				<th scope="row" class="titledesc"><?php echo $settings['title'];?></th>
160
-				<td class="forminp forminp-<?php echo sanitize_title( $settings['type'] ) ?>">
161
-					<a href="<?php echo $settings['link']; ?>" class="button-secondary <?php echo esc_attr( $settings['class'] ); ?>">
159
+				<th scope="row" class="titledesc"><?php echo $settings['title']; ?></th>
160
+				<td class="forminp forminp-<?php echo sanitize_title($settings['type']) ?>">
161
+					<a href="<?php echo $settings['link']; ?>" class="button-secondary <?php echo esc_attr($settings['class']); ?>">
162 162
 						<?php echo $settings['button_text']; ?>
163 163
 					</a>
164
-					<span class="description"><?php echo $settings['desc'];?></span>
164
+					<span class="description"><?php echo $settings['desc']; ?></span>
165 165
 				</td>
166 166
 			</tr>
167 167
 			<?php
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		public function output() {
179 179
 			$settings = $this->get_settings();
180 180
 
181
-			Auto_Load_Next_Post_Admin_Settings::output_fields( $settings );
181
+			Auto_Load_Next_Post_Admin_Settings::output_fields($settings);
182 182
 		} // END output()
183 183
 
184 184
 		/**
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		public function save() {
191 191
 			$settings = $this->get_settings();
192 192
 
193
-			Auto_Load_Next_Post_Admin_Settings::save_fields( $settings );
193
+			Auto_Load_Next_Post_Admin_Settings::save_fields($settings);
194 194
 		} // END save()
195 195
 
196 196
 	} // END class
Please login to merge, or discard this patch.
includes/admin/class-alnp-admin-settings.php 1 patch
Spacing   +177 added lines, -177 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('Auto_Load_Next_Post_Admin_Settings' ) ) {
18
+if ( ! class_exists('Auto_Load_Next_Post_Admin_Settings')) {
19 19
 
20 20
 	class Auto_Load_Next_Post_Admin_Settings {
21 21
 
@@ -56,16 +56,16 @@  discard block
 block discarded – undo
56 56
 		 * @return  $settings
57 57
 		 */
58 58
 		public static function get_settings_pages() {
59
-			if ( empty( self::$settings ) ) {
59
+			if (empty(self::$settings)) {
60 60
 				$settings = array();
61 61
 
62
-				include_once( dirname( __FILE__ ) . '/settings/class-alnp-settings-page.php' );
62
+				include_once(dirname(__FILE__).'/settings/class-alnp-settings-page.php');
63 63
 
64
-				$settings[] = include( dirname( __FILE__ ) . '/settings/class-alnp-settings-theme-selectors.php');
65
-				$settings[] = include( dirname( __FILE__ ) . '/settings/class-alnp-settings-misc.php');
66
-				$settings[] = include( dirname( __FILE__ ) . '/settings/class-alnp-settings-events.php');
64
+				$settings[] = include(dirname(__FILE__).'/settings/class-alnp-settings-theme-selectors.php');
65
+				$settings[] = include(dirname(__FILE__).'/settings/class-alnp-settings-misc.php');
66
+				$settings[] = include(dirname(__FILE__).'/settings/class-alnp-settings-events.php');
67 67
 
68
-				self::$settings = apply_filters( 'auto_load_next_post_get_settings_pages', $settings );
68
+				self::$settings = apply_filters('auto_load_next_post_get_settings_pages', $settings);
69 69
 			}
70 70
 
71 71
 			return self::$settings;
@@ -83,16 +83,16 @@  discard block
 block discarded – undo
83 83
 		public static function save() {
84 84
 			global $current_tab;
85 85
 
86
-			check_admin_referer( 'auto-load-next-post-settings' );
86
+			check_admin_referer('auto-load-next-post-settings');
87 87
 
88 88
 			// Trigger actions
89
-			do_action( 'auto_load_next_post_settings_save_' . $current_tab );
90
-			do_action( 'auto_load_next_post_update_options_' . $current_tab );
91
-			do_action( 'auto_load_next_post_update_options' );
89
+			do_action('auto_load_next_post_settings_save_'.$current_tab);
90
+			do_action('auto_load_next_post_update_options_'.$current_tab);
91
+			do_action('auto_load_next_post_update_options');
92 92
 
93
-			self::add_message( __( 'Your settings have been saved.', 'auto-load-next-post' ) );
93
+			self::add_message(__('Your settings have been saved.', 'auto-load-next-post'));
94 94
 
95
-			do_action( 'auto_load_next_post_settings_saved' );
95
+			do_action('auto_load_next_post_settings_saved');
96 96
 		} // END save()
97 97
 
98 98
 		/**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 		 * @since  1.0.0
104 104
 		 * @param  string $text Message
105 105
 		 */
106
-		public static function add_message( $text ) {
106
+		public static function add_message($text) {
107 107
 			self::$messages[] = $text;
108 108
 		} // END add_message()
109 109
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 		 * @since  1.0.0
116 116
 		 * @param  string $text Error
117 117
 		 */
118
-		public static function add_error( $text ) {
118
+		public static function add_error($text) {
119 119
 			self::$errors[] = $text;
120 120
 		} // END add_error()
121 121
 
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
 		 * @return string
129 129
 		 */
130 130
 		public static function show_messages() {
131
-			if ( count( self::$errors ) > 0 ) {
132
-				foreach ( self::$errors as $error ) {
133
-					echo '<div id="message" class="error inline"><p><strong>' . esc_html( $error ) . '</strong></p></div>';
131
+			if (count(self::$errors) > 0) {
132
+				foreach (self::$errors as $error) {
133
+					echo '<div id="message" class="error inline"><p><strong>'.esc_html($error).'</strong></p></div>';
134 134
 				}
135
-			} elseif ( count( self::$messages ) > 0 ) {
136
-				foreach ( self::$messages as $message ) {
137
-					echo '<div id="message" class="updated inline"><p><strong>' . esc_html( $message ) . '</strong></p></div>';
135
+			} elseif (count(self::$messages) > 0) {
136
+				foreach (self::$messages as $message) {
137
+					echo '<div id="message" class="updated inline"><p><strong>'.esc_html($message).'</strong></p></div>';
138 138
 				}
139 139
 			}
140 140
 		} // END show_messages()
@@ -156,12 +156,12 @@  discard block
 block discarded – undo
156 156
 		public static function output() {
157 157
 			global $current_section, $current_tab;
158 158
 
159
-			do_action( 'auto_load_next_post_settings_start' );
159
+			do_action('auto_load_next_post_settings_start');
160 160
 
161 161
 			// Get tabs for the settings page
162
-			$tabs = apply_filters( 'auto_load_next_post_settings_tabs_array', array() );
162
+			$tabs = apply_filters('auto_load_next_post_settings_tabs_array', array());
163 163
 
164
-			include( dirname( __FILE__ ) . '/views/html-admin-settings.php' );
164
+			include(dirname(__FILE__).'/views/html-admin-settings.php');
165 165
 		} // END output()
166 166
 
167 167
 		/**
@@ -173,33 +173,33 @@  discard block
 block discarded – undo
173 173
 		 * @param  mixed $option_name
174 174
 		 * @return string
175 175
 		 */
176
-		public static function get_option( $option_name, $default = '' ) {
176
+		public static function get_option($option_name, $default = '') {
177 177
 			// Array value
178
-			if ( strstr( $option_name, '[' ) ) {
179
-				parse_str( $option_name, $option_array );
178
+			if (strstr($option_name, '[')) {
179
+				parse_str($option_name, $option_array);
180 180
 
181 181
 				// Option name is first key
182
-				$option_name = current( array_keys( $option_array ) );
182
+				$option_name = current(array_keys($option_array));
183 183
 
184 184
 				// Get value
185
-				$option_values = get_option( $option_name, '' );
185
+				$option_values = get_option($option_name, '');
186 186
 
187
-				$key = key( $option_array[$option_name] );
187
+				$key = key($option_array[$option_name]);
188 188
 
189
-				if ( isset( $option_values[$key] ) ) {
189
+				if (isset($option_values[$key])) {
190 190
 					$option_value = $option_values[$key];
191 191
 				} else {
192 192
 					$option_value = null;
193 193
 				}
194 194
 			} else {
195 195
 				// Single value
196
-				$option_value = get_option( $option_name, null );
196
+				$option_value = get_option($option_name, null);
197 197
 			}
198 198
 
199
-			if ( is_array( $option_value ) ) {
200
-				$option_value = array_map( 'stripslashes', $option_value );
201
-			} elseif ( ! is_null( $option_value ) ) {
202
-				$option_value = stripslashes( $option_value );
199
+			if (is_array($option_value)) {
200
+				$option_value = array_map('stripslashes', $option_value);
201
+			} elseif ( ! is_null($option_value)) {
202
+				$option_value = stripslashes($option_value);
203 203
 			}
204 204
 
205 205
 			return $option_value === null ? $default : $option_value;
@@ -216,84 +216,84 @@  discard block
 block discarded – undo
216 216
 		 * @version 1.5.0
217 217
 		 * @param   array $options Opens array to output
218 218
 		 */
219
-		public static function output_fields( $options ) {
220
-			foreach ( $options as $key => $value ) {
219
+		public static function output_fields($options) {
220
+			foreach ($options as $key => $value) {
221 221
 
222
-			if ( ! isset( $value['type'] ) ) {
222
+			if ( ! isset($value['type'])) {
223 223
 					continue;
224 224
 				}
225
-				if ( ! isset( $value['id'] ) ) {
225
+				if ( ! isset($value['id'])) {
226 226
 					$value['id'] = '';
227 227
 				}
228
-				if ( ! isset( $value['title'] ) ) {
229
-					$value['title'] = isset( $value['name'] ) ? $value['name'] : '';
228
+				if ( ! isset($value['title'])) {
229
+					$value['title'] = isset($value['name']) ? $value['name'] : '';
230 230
 				}
231
-				if ( ! isset( $value['class'] ) ) {
231
+				if ( ! isset($value['class'])) {
232 232
 					$value['class'] = '';
233 233
 				}
234
-				if ( ! isset( $value['css'] ) ) {
234
+				if ( ! isset($value['css'])) {
235 235
 					$value['css'] = '';
236 236
 				}
237
-				if ( ! isset( $value['default'] ) ) {
237
+				if ( ! isset($value['default'])) {
238 238
 					$value['default'] = '';
239 239
 				}
240
-				if ( ! isset( $value['desc'] ) ) {
240
+				if ( ! isset($value['desc'])) {
241 241
 					$value['desc'] = '';
242 242
 				}
243
-				if ( ! isset( $value['placeholder'] ) ) {
243
+				if ( ! isset($value['placeholder'])) {
244 244
 					$value['placeholder'] = '';
245 245
 				}
246 246
 
247 247
 				// Custom attribute handling
248 248
 				$custom_attributes = array();
249 249
 
250
-				if ( ! empty( $value['custom_attributes'] ) && is_array( $value['custom_attributes'] ) ) {
251
-					foreach ( $value['custom_attributes'] as $attribute => $attribute_value ) {
252
-						$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
250
+				if ( ! empty($value['custom_attributes']) && is_array($value['custom_attributes'])) {
251
+					foreach ($value['custom_attributes'] as $attribute => $attribute_value) {
252
+						$custom_attributes[] = esc_attr($attribute).'="'.esc_attr($attribute_value).'"';
253 253
 					}
254 254
 				}
255 255
 
256 256
 				// Description handling
257
-				if ( ! empty( $value['desc'] ) ) {
257
+				if ( ! empty($value['desc'])) {
258 258
 					$description = $value['desc'];
259 259
 				}
260 260
 
261
-				if ( $description && in_array( $value['type'], array( 'textarea', 'radio' ), true ) ) {
262
-					$description = '<p style="margin-top:0">' . wp_kses_post( $description ) . '</p>';
263
-				} elseif ( $description && in_array( $value['type'], array( 'checkbox' ), true ) ) {
264
-					$description = wp_kses_post( $description );
265
-				} elseif ( $description ) {
266
-					$description = '<p class="description">' . wp_kses_post( $description ) . '</p>';
261
+				if ($description && in_array($value['type'], array('textarea', 'radio'), true)) {
262
+					$description = '<p style="margin-top:0">'.wp_kses_post($description).'</p>';
263
+				} elseif ($description && in_array($value['type'], array('checkbox'), true)) {
264
+					$description = wp_kses_post($description);
265
+				} elseif ($description) {
266
+					$description = '<p class="description">'.wp_kses_post($description).'</p>';
267 267
 				}
268 268
 
269 269
 				// Switch based on type
270
-				switch( $value['type'] ) {
270
+				switch ($value['type']) {
271 271
 
272 272
 					// Section Titles
273 273
 					case 'title':
274
-						if ( ! empty( $value['title'] ) ) {
275
-							echo '<h2>' . esc_html( $value['title'] ) . '</h2>';
274
+						if ( ! empty($value['title'])) {
275
+							echo '<h2>'.esc_html($value['title']).'</h2>';
276 276
 						}
277
-						if ( ! empty( $value['desc'] ) ) {
278
-							echo '<div id="' . esc_attr( sanitize_title( $value['id'] ) ) . '-description">';
279
-							echo wp_kses_post( wpautop( wptexturize( $value['desc'] ) ) );
277
+						if ( ! empty($value['desc'])) {
278
+							echo '<div id="'.esc_attr(sanitize_title($value['id'])).'-description">';
279
+							echo wp_kses_post(wpautop(wptexturize($value['desc'])));
280 280
 							echo '</div>';
281 281
 						}
282 282
 						echo '<table class="form-table">'."\n\n";
283
-						if ( ! empty( $value['id'] ) ) {
284
-							do_action( 'auto_load_next_post_settings_' . sanitize_title( $value['id'] ) );
283
+						if ( ! empty($value['id'])) {
284
+							do_action('auto_load_next_post_settings_'.sanitize_title($value['id']));
285 285
 						}
286 286
 
287 287
 						break;
288 288
 
289 289
 					// Section Ends
290 290
 					case 'sectionend':
291
-						if ( ! empty( $value['id'] ) ) {
292
-							do_action( 'auto_load_next_post_settings_' . sanitize_title( $value['id'] ) . '_end' );
291
+						if ( ! empty($value['id'])) {
292
+							do_action('auto_load_next_post_settings_'.sanitize_title($value['id']).'_end');
293 293
 						}
294 294
 						echo '</table>';
295
-						if ( ! empty( $value['id'] ) ) {
296
-							do_action( 'auto_load_next_post_settings_' . sanitize_title( $value['id'] ) . '_after' );
295
+						if ( ! empty($value['id'])) {
296
+							do_action('auto_load_next_post_settings_'.sanitize_title($value['id']).'_after');
297 297
 						}
298 298
 						break;
299 299
 
@@ -306,22 +306,22 @@  discard block
 block discarded – undo
306 306
 					case 'time':
307 307
 					case 'week':
308 308
 					case 'email':
309
-						$option_value = self::get_option( $value['id'], $value['default'] );
309
+						$option_value = self::get_option($value['id'], $value['default']);
310 310
 
311 311
 						?><tr valign="top">
312 312
 							<th scope="row" class="titledesc">
313
-								<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
313
+								<label for="<?php echo esc_attr($value['id']); ?>"><?php echo esc_html($value['title']); ?></label>
314 314
 							</th>
315
-							<td class="forminp forminp-<?php echo esc_attr( sanitize_title( $value['type'] ) ); ?>">
315
+							<td class="forminp forminp-<?php echo esc_attr(sanitize_title($value['type'])); ?>">
316 316
 								<input
317
-									name="<?php echo esc_attr( $value['id'] ); ?>"
318
-									id="<?php echo esc_attr( $value['id'] ); ?>"
319
-									type="<?php echo esc_attr( $value['type'] ); ?>"
320
-									style="<?php echo esc_attr( $value['css'] ); ?>"
321
-									value="<?php echo esc_attr( $option_value ); ?>"
322
-									class="<?php echo esc_attr( $value['class'] ); ?>"
323
-									placeholder="<?php echo esc_attr( $value['placeholder'] ); ?>"
324
-									<?php echo implode(' ', $custom_attributes ); ?>
317
+									name="<?php echo esc_attr($value['id']); ?>"
318
+									id="<?php echo esc_attr($value['id']); ?>"
319
+									type="<?php echo esc_attr($value['type']); ?>"
320
+									style="<?php echo esc_attr($value['css']); ?>"
321
+									value="<?php echo esc_attr($option_value); ?>"
322
+									class="<?php echo esc_attr($value['class']); ?>"
323
+									placeholder="<?php echo esc_attr($value['placeholder']); ?>"
324
+									<?php echo implode(' ', $custom_attributes); ?>
325 325
 								/><?php echo $description; ?>
326 326
 							</td>
327 327
 						</tr><?php
@@ -329,23 +329,23 @@  discard block
 block discarded – undo
329 329
 
330 330
 					// Textarea.
331 331
 					case 'textarea':
332
-						$option_value = self::get_option( $value['id'], $value['default'] );
332
+						$option_value = self::get_option($value['id'], $value['default']);
333 333
 						?>
334 334
 						<tr valign="top">
335 335
 							<th scope="row" class="titledesc">
336
-								<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
336
+								<label for="<?php echo esc_attr($value['id']); ?>"><?php echo esc_html($value['title']); ?></label>
337 337
 							</th>
338
-							<td class="forminp forminp-<?php echo esc_attr( sanitize_title( $value['type'] ) ); ?>">
338
+							<td class="forminp forminp-<?php echo esc_attr(sanitize_title($value['type'])); ?>">
339 339
 								<?php echo $description; ?>
340 340
 
341 341
 								<textarea
342
-									name="<?php echo esc_attr( $value['id'] ); ?>"
343
-									id="<?php echo esc_attr( $value['id'] ); ?>"
344
-									style="<?php echo esc_attr( $value['css'] ); ?>"
345
-									class="<?php echo esc_attr( $value['class'] ); ?>"
346
-									placeholder="<?php echo esc_attr( $value['placeholder'] ); ?>"
347
-									<?php echo implode( ' ', $custom_attributes ); ?>
348
-									><?php echo esc_textarea( $option_value ); ?></textarea>
342
+									name="<?php echo esc_attr($value['id']); ?>"
343
+									id="<?php echo esc_attr($value['id']); ?>"
344
+									style="<?php echo esc_attr($value['css']); ?>"
345
+									class="<?php echo esc_attr($value['class']); ?>"
346
+									placeholder="<?php echo esc_attr($value['placeholder']); ?>"
347
+									<?php echo implode(' ', $custom_attributes); ?>
348
+									><?php echo esc_textarea($option_value); ?></textarea>
349 349
 							</td>
350 350
 						</tr>
351 351
 						<?php
@@ -354,35 +354,35 @@  discard block
 block discarded – undo
354 354
 					// Select boxes.
355 355
 					case 'select':
356 356
 					case 'multiselect':
357
-						$option_value = self::get_option( $value['id'], $value['default'] );
357
+						$option_value = self::get_option($value['id'], $value['default']);
358 358
 						?>
359 359
 						<tr valign="top">
360 360
 							<th scope="row" class="titledesc">
361
-								<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
361
+								<label for="<?php echo esc_attr($value['id']); ?>"><?php echo esc_html($value['title']); ?></label>
362 362
 							</th>
363
-							<td class="forminp forminp-<?php echo esc_attr( sanitize_title( $value['type'] ) ); ?>">
363
+							<td class="forminp forminp-<?php echo esc_attr(sanitize_title($value['type'])); ?>">
364 364
 								<select
365
-									name="<?php echo esc_attr( $value['id'] ); ?><?php echo ( 'multiselect' === $value['type'] ) ? '[]' : ''; ?>"
366
-									id="<?php echo esc_attr( $value['id'] ); ?>"
367
-									style="<?php echo esc_attr( $value['css'] ); ?>"
368
-									class="<?php echo esc_attr( $value['class'] ); ?>"
369
-									data-placeholder="<?php echo esc_attr( $value['placeholder'] ); ?>"
370
-									<?php echo implode( ' ', $custom_attributes ); ?>
365
+									name="<?php echo esc_attr($value['id']); ?><?php echo ('multiselect' === $value['type']) ? '[]' : ''; ?>"
366
+									id="<?php echo esc_attr($value['id']); ?>"
367
+									style="<?php echo esc_attr($value['css']); ?>"
368
+									class="<?php echo esc_attr($value['class']); ?>"
369
+									data-placeholder="<?php echo esc_attr($value['placeholder']); ?>"
370
+									<?php echo implode(' ', $custom_attributes); ?>
371 371
 									<?php echo 'multiselect' === $value['type'] ? 'multiple="multiple"' : ''; ?>
372 372
 									>
373 373
 									<?php
374
-									foreach ( $value['options'] as $key => $val ) {
374
+									foreach ($value['options'] as $key => $val) {
375 375
 										?>
376
-										<option value="<?php echo esc_attr( $key ); ?>"
376
+										<option value="<?php echo esc_attr($key); ?>"
377 377
 											<?php
378
-											if ( is_array( $option_value ) ) {
379
-												selected( in_array( (string) $key, $option_value, true ), true );
378
+											if (is_array($option_value)) {
379
+												selected(in_array((string) $key, $option_value, true), true);
380 380
 											} else {
381
-												selected( $option_value, (string) $key );
381
+												selected($option_value, (string) $key);
382 382
 											}
383 383
 											?>
384 384
 											>
385
-											<?php echo esc_html( $val ); ?></option>
385
+											<?php echo esc_html($val); ?></option>
386 386
 											<?php
387 387
 									}
388 388
 									?>
@@ -394,29 +394,29 @@  discard block
 block discarded – undo
394 394
 
395 395
 					// Radio inputs.
396 396
 					case 'radio':
397
-						$option_value = self::get_option( $value['id'], $value['default'] );
397
+						$option_value = self::get_option($value['id'], $value['default']);
398 398
 						?>
399 399
 						<tr valign="top">
400 400
 							<th scope="row" class="titledesc">
401
-								<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
401
+								<label for="<?php echo esc_attr($value['id']); ?>"><?php echo esc_html($value['title']); ?></label>
402 402
 							</th>
403
-							<td class="forminp forminp-<?php echo esc_attr( sanitize_title( $value['type'] ) ); ?>">
403
+							<td class="forminp forminp-<?php echo esc_attr(sanitize_title($value['type'])); ?>">
404 404
 								<fieldset>
405 405
 									<?php echo $description; ?>
406 406
 									<ul>
407 407
 									<?php
408
-									foreach ( $value['options'] as $key => $val ) {
408
+									foreach ($value['options'] as $key => $val) {
409 409
 										?>
410 410
 										<li>
411 411
 											<label><input
412
-													name="<?php echo esc_attr( $value['id'] ); ?>"
413
-													value="<?php echo esc_attr( $key ); ?>"
412
+													name="<?php echo esc_attr($value['id']); ?>"
413
+													value="<?php echo esc_attr($key); ?>"
414 414
 													type="radio"
415
-													style="<?php echo esc_attr( $value['css'] ); ?>"
416
-													class="<?php echo esc_attr( $value['class'] ); ?>"
417
-													<?php echo implode( ' ', $custom_attributes ); // WPCS: XSS ok. ?>
418
-													<?php checked( $key, $option_value ); ?>
419
-													/> <?php echo esc_html( $val ); ?></label>
415
+													style="<?php echo esc_attr($value['css']); ?>"
416
+													class="<?php echo esc_attr($value['class']); ?>"
417
+													<?php echo implode(' ', $custom_attributes); // WPCS: XSS ok. ?>
418
+													<?php checked($key, $option_value); ?>
419
+													/> <?php echo esc_html($val); ?></label>
420 420
 										</li>
421 421
 										<?php
422 422
 									}
@@ -430,58 +430,58 @@  discard block
 block discarded – undo
430 430
 
431 431
 					// Checkbox input.
432 432
 					case 'checkbox':
433
-						$option_value     = self::get_option( $value['id'], $value['default'] );
433
+						$option_value     = self::get_option($value['id'], $value['default']);
434 434
 						$visibility_class = array();
435 435
 
436
-						if ( ! isset( $value['hide_if_checked'] ) ) {
436
+						if ( ! isset($value['hide_if_checked'])) {
437 437
 							$value['hide_if_checked'] = false;
438 438
 						}
439
-						if ( ! isset( $value['show_if_checked'] ) ) {
439
+						if ( ! isset($value['show_if_checked'])) {
440 440
 							$value['show_if_checked'] = false;
441 441
 						}
442
-						if ( 'yes' === $value['hide_if_checked'] || 'yes' === $value['show_if_checked'] ) {
442
+						if ('yes' === $value['hide_if_checked'] || 'yes' === $value['show_if_checked']) {
443 443
 							$visibility_class[] = 'hidden_option';
444 444
 						}
445
-						if ( 'option' === $value['hide_if_checked'] ) {
445
+						if ('option' === $value['hide_if_checked']) {
446 446
 							$visibility_class[] = 'hide_options_if_checked';
447 447
 						}
448
-						if ( 'option' === $value['show_if_checked'] ) {
448
+						if ('option' === $value['show_if_checked']) {
449 449
 							$visibility_class[] = 'show_options_if_checked';
450 450
 						}
451 451
 
452
-						if ( ! isset( $value['checkboxgroup'] ) || 'start' === $value['checkboxgroup'] ) {
452
+						if ( ! isset($value['checkboxgroup']) || 'start' === $value['checkboxgroup']) {
453 453
 							?>
454
-								<tr valign="top" class="<?php echo esc_attr( implode( ' ', $visibility_class ) ); ?>">
455
-									<th scope="row" class="titledesc"><?php echo esc_html( $value['title'] ); ?></th>
454
+								<tr valign="top" class="<?php echo esc_attr(implode(' ', $visibility_class)); ?>">
455
+									<th scope="row" class="titledesc"><?php echo esc_html($value['title']); ?></th>
456 456
 									<td class="forminp forminp-checkbox">
457 457
 										<fieldset>
458 458
 							<?php
459 459
 						} else {
460 460
 							?>
461
-								<fieldset class="<?php echo esc_attr( implode( ' ', $visibility_class ) ); ?>">
461
+								<fieldset class="<?php echo esc_attr(implode(' ', $visibility_class)); ?>">
462 462
 							<?php
463 463
 						}
464 464
 
465
-						if ( ! empty( $value['title'] ) ) {
465
+						if ( ! empty($value['title'])) {
466 466
 							?>
467
-								<legend class="screen-reader-text"><span><?php echo esc_html( $value['title'] ); ?></span></legend>
467
+								<legend class="screen-reader-text"><span><?php echo esc_html($value['title']); ?></span></legend>
468 468
 							<?php
469 469
 						}
470 470
 						?>
471
-								<label for="<?php echo esc_attr( $value['id'] ); ?>">
471
+								<label for="<?php echo esc_attr($value['id']); ?>">
472 472
 									<input
473
-										name="<?php echo esc_attr( $value['id'] ); ?>"
474
-										id="<?php echo esc_attr( $value['id'] ); ?>"
473
+										name="<?php echo esc_attr($value['id']); ?>"
474
+										id="<?php echo esc_attr($value['id']); ?>"
475 475
 										type="checkbox"
476
-										class="<?php echo esc_attr( isset( $value['class'] ) ? $value['class'] : '' ); ?>"
476
+										class="<?php echo esc_attr(isset($value['class']) ? $value['class'] : ''); ?>"
477 477
 										value="1"
478
-										<?php checked( $option_value, 'yes' ); ?>
479
-										<?php echo implode( ' ', $custom_attributes ); ?>
478
+										<?php checked($option_value, 'yes'); ?>
479
+										<?php echo implode(' ', $custom_attributes); ?>
480 480
 									/> <?php echo $description; ?>
481 481
 								</label>
482 482
 								<?php
483 483
 
484
-								if ( ! isset( $value['checkboxgroup'] ) || 'end' === $value['checkboxgroup'] ) {
484
+								if ( ! isset($value['checkboxgroup']) || 'end' === $value['checkboxgroup']) {
485 485
 									?>
486 486
 										</fieldset>
487 487
 									</td>
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
 
497 497
 					// Default: run an action
498 498
 					default:
499
-						do_action( 'auto_load_next_post_admin_field_' . $value['type'], $value );
499
+						do_action('auto_load_next_post_admin_field_'.$value['type'], $value);
500 500
 
501 501
 						break;
502 502
 				} // end switch()
@@ -515,8 +515,8 @@  discard block
 block discarded – undo
515 515
 		 * @param   array $options Opens array to output
516 516
 		 * @return  bool
517 517
 		 */
518
-		public static function save_fields( $options ) {
519
-			if ( empty( $_POST ) ) {
518
+		public static function save_fields($options) {
519
+			if (empty($_POST)) {
520 520
 				return false;
521 521
 			}
522 522
 
@@ -525,48 +525,48 @@  discard block
 block discarded – undo
525 525
 			$autoload_options = array();
526 526
 
527 527
 			// Loop options and get values to save
528
-			foreach ( $options as $option ) {
529
-				if ( ! isset( $option['id'] ) || ! isset( $option['type'] ) ) {
528
+			foreach ($options as $option) {
529
+				if ( ! isset($option['id']) || ! isset($option['type'])) {
530 530
 					continue;
531 531
 				}
532 532
 
533 533
 				// Get posted value.
534
-				if ( strstr( $option['id'], '[' ) ) {
535
-					parse_str( $option['id'], $option_name_array );
536
-					$option_name  = current( array_keys( $option_name_array ) );
537
-					$setting_name = key( $option_name_array[ $option_name ] );
538
-					$raw_value    = isset( $_POST[ $option_name ][ $setting_name ] ) ? wp_unslash( $_POST[ $option_name ][ $setting_name ] ) : null;
534
+				if (strstr($option['id'], '[')) {
535
+					parse_str($option['id'], $option_name_array);
536
+					$option_name  = current(array_keys($option_name_array));
537
+					$setting_name = key($option_name_array[$option_name]);
538
+					$raw_value    = isset($_POST[$option_name][$setting_name]) ? wp_unslash($_POST[$option_name][$setting_name]) : null;
539 539
 				} else {
540 540
 					$option_name  = $option['id'];
541 541
 					$setting_name = '';
542
-					$raw_value    = isset( $_POST[ $option['id'] ] ) ? wp_unslash( $_POST[ $option['id'] ] ) : null;
542
+					$raw_value    = isset($_POST[$option['id']]) ? wp_unslash($_POST[$option['id']]) : null;
543 543
 				}
544 544
 
545
-				switch ( $option['type'] ) {
545
+				switch ($option['type']) {
546 546
 					case "checkbox" :
547 547
 						$value = '1' === $raw_value || 'yes' === $raw_value ? 'yes' : 'no';
548 548
 						break;
549 549
 
550 550
 					case "textarea" :
551
-						$value = wp_kses_post( trim( stripslashes( $_POST[$option['id']] ) ) );
551
+						$value = wp_kses_post(trim(stripslashes($_POST[$option['id']])));
552 552
 						break;
553 553
 
554 554
 					case "multiselect" :
555
-						$value = array_filter( array_map( 'auto_load_next_post_clean', (array) $raw_value ) );
555
+						$value = array_filter(array_map('auto_load_next_post_clean', (array) $raw_value));
556 556
 						break;
557 557
 
558 558
 					case 'select' :
559
-						$allowed_values = empty( $option['options'] ) ? array() : array_map( 'strval', array_keys( $option['options'] ) );
560
-						if ( empty( $option['default'] ) && empty( $allowed_values ) ) {
559
+						$allowed_values = empty($option['options']) ? array() : array_map('strval', array_keys($option['options']));
560
+						if (empty($option['default']) && empty($allowed_values)) {
561 561
 							$value = null;
562 562
 							break;
563 563
 						}
564
-						$default = ( empty( $option['default'] ) ? $allowed_values[0] : $option['default'] );
565
-						$value   = in_array( $raw_value, $allowed_values, true ) ? $raw_value : $default;
564
+						$default = (empty($option['default']) ? $allowed_values[0] : $option['default']);
565
+						$value   = in_array($raw_value, $allowed_values, true) ? $raw_value : $default;
566 566
 						break;
567 567
 
568 568
 					default :
569
-						$value = auto_load_next_post_clean( $raw_value );
569
+						$value = auto_load_next_post_clean($raw_value);
570 570
 						break;
571 571
 				} // END switch()
572 572
 
@@ -575,59 +575,59 @@  discard block
 block discarded – undo
575 575
 				 *
576 576
 				 * @deprecated 1.5.0 - doesn't allow manipulation of values!
577 577
 				 */
578
-				if ( has_action( 'auto_load_next_post_update_option_' . sanitize_title( $option['type'] ) ) ) {
579
-					if ( is_ajax() ) {
580
-						error_log( 'auto_load_next_post_update_option_' . sanitize_title( $option['type'] ) . ' is deprecated since version 1.5.0' );
578
+				if (has_action('auto_load_next_post_update_option_'.sanitize_title($option['type']))) {
579
+					if (is_ajax()) {
580
+						error_log('auto_load_next_post_update_option_'.sanitize_title($option['type']).' is deprecated since version 1.5.0');
581 581
 					} else {
582
-						_deprecated_hook( 'auto_load_next_post_update_option_' . sanitize_title( $option['type'] ), '1.5.0' );
582
+						_deprecated_hook('auto_load_next_post_update_option_'.sanitize_title($option['type']), '1.5.0');
583 583
 					}
584 584
 
585
-					do_action( 'auto_load_next_post_update_option_' . sanitize_title( $option['type'] ), $option );
585
+					do_action('auto_load_next_post_update_option_'.sanitize_title($option['type']), $option);
586 586
 					continue;
587 587
 				}
588 588
 
589
-				if ( is_null( $value ) ) {
589
+				if (is_null($value)) {
590 590
 					continue;
591 591
 				}
592 592
 
593 593
 				// Check if option is an array and handle that differently to single values.
594
-				if ( $option_name && $setting_name ) {
595
-					if ( ! isset( $update_options[ $option_name ] ) ) {
596
-						$update_options[ $option_name ] = get_option( $option_name, array() );
594
+				if ($option_name && $setting_name) {
595
+					if ( ! isset($update_options[$option_name])) {
596
+						$update_options[$option_name] = get_option($option_name, array());
597 597
 					}
598
-					if ( ! is_array( $update_options[ $option_name ] ) ) {
599
-						$update_options[ $option_name ] = array();
598
+					if ( ! is_array($update_options[$option_name])) {
599
+						$update_options[$option_name] = array();
600 600
 					}
601
-					$update_options[ $option_name ][ $setting_name ] = $value;
601
+					$update_options[$option_name][$setting_name] = $value;
602 602
 				} else {
603
-					$update_options[ $option_name ] = $value;
603
+					$update_options[$option_name] = $value;
604 604
 				}
605 605
 
606
-				$autoload_options[ $option_name ] = isset( $option['autoload'] ) ? (bool) $option['autoload'] : true;
606
+				$autoload_options[$option_name] = isset($option['autoload']) ? (bool) $option['autoload'] : true;
607 607
 
608 608
 				/**
609 609
 				 * Fire an action before saved.
610 610
 				 *
611 611
 				 * @deprecated 1.5.0 - doesn't allow manipulation of values!
612 612
 				 */
613
-				if ( has_action( 'auto_load_next_post_update_option' ) ) {
614
-					if ( is_ajax() ) {
615
-						error_log( 'auto_load_next_post_update_option is deprecated since version 1.5.0' );
613
+				if (has_action('auto_load_next_post_update_option')) {
614
+					if (is_ajax()) {
615
+						error_log('auto_load_next_post_update_option is deprecated since version 1.5.0');
616 616
 					} else {
617
-						_deprecated_hook( 'auto_load_next_post_update_option', '1.5.0' );
617
+						_deprecated_hook('auto_load_next_post_update_option', '1.5.0');
618 618
 					}
619 619
 
620
-					do_action( 'auto_load_next_post_update_option', $option );
620
+					do_action('auto_load_next_post_update_option', $option);
621 621
 				}
622 622
 			}
623 623
 
624 624
 			// Now save the options
625
-			foreach ( $update_options as $name => $value ) {
626
-				update_option( $name, $value, $autoload_options[ $name ] ? 'yes' : 'no' );
625
+			foreach ($update_options as $name => $value) {
626
+				update_option($name, $value, $autoload_options[$name] ? 'yes' : 'no');
627 627
 			}
628 628
 
629 629
 			// Save all options as an array. Ready for export.
630
-			update_option( 'auto_load_next_post_options', $update_options );
630
+			update_option('auto_load_next_post_options', $update_options);
631 631
 
632 632
 			return true;
633 633
 		} // END save_fields()
Please login to merge, or discard this patch.
includes/theme-support/class-alnp-twenty-seventeen.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  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
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public static function init() {
31 31
 		// Add theme support and preset the theme selectors.
32
-		add_action( 'after_setup_theme', array( __CLASS__, 'add_theme_support' ) );
32
+		add_action('after_setup_theme', array(__CLASS__, 'add_theme_support'));
33 33
 	} // END init()
34 34
 
35 35
 	/**
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 	 * @static
41 41
 	 */
42 42
 	public static function add_theme_support() {
43
-		add_theme_support( 'auto-load-next-post', array(
43
+		add_theme_support('auto-load-next-post', array(
44 44
 			'content_container'    => 'main.site-main',
45 45
 			'title_selector'       => 'h1.entry-title',
46 46
 			'navigation_container' => 'nav.post-navigation',
47 47
 			'comments_container'   => 'section#comments',
48 48
 			'load_js_in_footer'    => 'no',
49 49
 			'lock_js_in_footer'    => 'no',
50
-		) );
50
+		));
51 51
 	} // END add_theme_support()
52 52
 
53 53
 } // END class
Please login to merge, or discard this patch.
includes/theme-support/class-alnp-twenty-sixteen.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  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
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public static function init() {
31 31
 		// Add theme support and preset the theme selectors.
32
-		add_action( 'after_setup_theme', array( __CLASS__, 'add_theme_support' ) );
32
+		add_action('after_setup_theme', array(__CLASS__, 'add_theme_support'));
33 33
 	} // END init()
34 34
 
35 35
 	/**
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 	 * @static
41 41
 	 */
42 42
 	public static function add_theme_support() {
43
-		add_theme_support( 'auto-load-next-post', array(
43
+		add_theme_support('auto-load-next-post', array(
44 44
 			'content_container'    => 'main.site-main',
45 45
 			'title_selector'       => 'h1.entry-title',
46 46
 			'navigation_container' => 'nav.post-navigation',
47 47
 			'comments_container'   => 'section#comments',
48 48
 			'load_js_in_footer'    => 'no',
49 49
 			'lock_js_in_footer'    => 'no',
50
-		) );
50
+		));
51 51
 	} // END add_theme_support()
52 52
 
53 53
 } // END class
Please login to merge, or discard this patch.
includes/theme-support/class-alnp-twenty-fifteen.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  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
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public static function init() {
31 31
 		// Add theme support and preset the theme selectors.
32
-		add_action( 'after_setup_theme', array( __CLASS__, 'add_theme_support' ) );
32
+		add_action('after_setup_theme', array(__CLASS__, 'add_theme_support'));
33 33
 	} // END init()
34 34
 
35 35
 	/**
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 	 * @static
41 41
 	 */
42 42
 	public static function add_theme_support() {
43
-		add_theme_support( 'auto-load-next-post', array(
43
+		add_theme_support('auto-load-next-post', array(
44 44
 			'content_container'    => 'main.site-main',
45 45
 			'title_selector'       => 'h1.entry-title',
46 46
 			'navigation_container' => 'nav.post-navigation',
47 47
 			'comments_container'   => 'section#comments',
48 48
 			'load_js_in_footer'    => 'no',
49 49
 			'lock_js_in_footer'    => 'no',
50
-		) );
50
+		));
51 51
 	} // END add_theme_support()
52 52
 
53 53
 } // END class
Please login to merge, or discard this patch.
auto-load-next-post.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  *
28 28
  * @version 1.5.0
29 29
  */
30
-if ( ! class_exists( 'Auto_Load_Next_Post' ) ) {
30
+if ( ! class_exists('Auto_Load_Next_Post')) {
31 31
 
32 32
 	class Auto_Load_Next_Post {
33 33
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		 * @return Auto_Load_Next_Post Single instance.
62 62
 		 */
63 63
 		public static function instance() {
64
-			if ( is_null( self::$_instance ) ) {
64
+			if (is_null(self::$_instance)) {
65 65
 				self::$_instance = new self();
66 66
 			}
67 67
 			return self::$_instance;
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		 */
77 77
 		public function __clone() {
78 78
 			// Cloning instances of the class is forbidden
79
-			_doing_it_wrong( __FUNCTION__, __( 'Cloning this object is forbidden.', 'auto-load-next-post' ), self::$version );
79
+			_doing_it_wrong(__FUNCTION__, __('Cloning this object is forbidden.', 'auto-load-next-post'), self::$version);
80 80
 		} // END __clone()
81 81
 
82 82
 		/**
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 		 * @return void
88 88
 		 */
89 89
 		public function __wakeup() {
90
-			_doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'auto-load-next-post' ), self::$version );
90
+			_doing_it_wrong(__FUNCTION__, __('Unserializing instances of this class is forbidden.', 'auto-load-next-post'), self::$version);
91 91
 		} // END __wakeup()
92 92
 
93 93
 		/**
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 			/**
107 107
 			 * Auto Load Next Post is fully loaded.
108 108
 			 */
109
-			do_action( 'auto_load_next_post_loaded' );
109
+			do_action('auto_load_next_post_loaded');
110 110
 		} // END __construct()
111 111
 
112 112
 		/**
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
 		 */
118 118
 		public function init_hooks() {
119 119
 			// Load translation files.
120
-			add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
120
+			add_action('init', array($this, 'load_plugin_textdomain'));
121 121
 
122 122
 			// Load Auto Load Next Post scripts on the frontend.
123
-			add_action( 'wp_enqueue_scripts', array( $this, 'alnp_enqueue_scripts' ) );
123
+			add_action('wp_enqueue_scripts', array($this, 'alnp_enqueue_scripts'));
124 124
 		} // END init_hooks()
125 125
 
126 126
 		/**
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 			$this->define('AUTO_LOAD_NEXT_POST_FILE', __FILE__);
136 136
 			$this->define('AUTO_LOAD_NEXT_POST_SLUG', 'auto-load-next-post');
137 137
 
138
-			$this->define('AUTO_LOAD_NEXT_POST_URL_PATH', untrailingslashit( plugins_url('/', __FILE__) ) );
139
-			$this->define('AUTO_LOAD_NEXT_POST_FILE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
138
+			$this->define('AUTO_LOAD_NEXT_POST_URL_PATH', untrailingslashit(plugins_url('/', __FILE__)));
139
+			$this->define('AUTO_LOAD_NEXT_POST_FILE_PATH', untrailingslashit(plugin_dir_path(__FILE__)));
140 140
 			$this->define('AUTO_LOAD_NEXT_POST_TEMPLATE_PATH', 'auto-load-next-post/');
141 141
 
142 142
 			$this->define('AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE', '4.4');
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
 		 * @access private
157 157
 		 * @since  1.4.3
158 158
 		 */
159
-		private function define( $name, $value ) {
160
-			if ( ! defined( $name ) ) {
161
-				define( $name, $value );
159
+		private function define($name, $value) {
160
+			if ( ! defined($name)) {
161
+				define($name, $value);
162 162
 			}
163 163
 		} // END define()
164 164
 
@@ -175,25 +175,25 @@  discard block
 block discarded – undo
175 175
 		 * @return  void
176 176
 		 */
177 177
 		public function includes() {
178
-			include_once( dirname( __FILE__ ) . '/includes/class-alnp-autoloader.php' ); // Autoloader.
179
-			include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-conditional-functions.php' ); // Conditional functions.
180
-			include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-formatting-functions.php' ); // Formatting functions.
181
-			include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-core-functions.php' ); // Contains core functions for the front/back end.
178
+			include_once(dirname(__FILE__).'/includes/class-alnp-autoloader.php'); // Autoloader.
179
+			include_once(dirname(__FILE__).'/includes/auto-load-next-post-conditional-functions.php'); // Conditional functions.
180
+			include_once(dirname(__FILE__).'/includes/auto-load-next-post-formatting-functions.php'); // Formatting functions.
181
+			include_once(dirname(__FILE__).'/includes/auto-load-next-post-core-functions.php'); // Contains core functions for the front/back end.
182 182
 
183 183
 			// Include theme support.
184 184
 			$this->alnp_include_theme_support();
185 185
 
186 186
 			// Customizer.
187
-			include_once( dirname( __FILE__ ) . '/includes/customizer/class-alnp-customizer.php' );
188
-			include_once( dirname( __FILE__ ) . '/includes/customizer/class-alnp-customizer-scripts.php' );
187
+			include_once(dirname(__FILE__).'/includes/customizer/class-alnp-customizer.php');
188
+			include_once(dirname(__FILE__).'/includes/customizer/class-alnp-customizer-scripts.php');
189 189
 
190 190
 			// Include admin class to handle all back-end functions.
191
-			if ( is_admin() ) {
192
-				include_once( dirname( __FILE__ ) . '/includes/admin/class-alnp-admin.php' ); // Admin section.
191
+			if (is_admin()) {
192
+				include_once(dirname(__FILE__).'/includes/admin/class-alnp-admin.php'); // Admin section.
193 193
 			}
194 194
 
195 195
 			// Install.
196
-			require_once( dirname( __FILE__ ) . '/includes/class-alnp-install.php' );
196
+			require_once(dirname(__FILE__).'/includes/class-alnp-install.php');
197 197
 		} // END includes()
198 198
 
199 199
 		/**
@@ -203,45 +203,45 @@  discard block
 block discarded – undo
203 203
 		 * @since  1.5.0
204 204
 		 */
205 205
 		public function alnp_include_theme_support() {
206
-			if ( is_alnp_active_theme( array( 'make', 'understrap', 'storefront', 'twentyseventeen', 'twentysixteen', 'twentyfifteen', 'twentyfourteen', 'twentythirteen', 'twentytwelve', 'twentyeleven', 'twentyten' ) ) ) {
206
+			if (is_alnp_active_theme(array('make', 'understrap', 'storefront', 'twentyseventeen', 'twentysixteen', 'twentyfifteen', 'twentyfourteen', 'twentythirteen', 'twentytwelve', 'twentyeleven', 'twentyten'))) {
207 207
 
208
-				switch ( get_template() ) {
208
+				switch (get_template()) {
209 209
 					case 'twentyten':
210
-						include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-ten.php' );
210
+						include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-ten.php');
211 211
 						break;
212 212
 					case 'twentyeleven':
213
-						include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-eleven.php' );
213
+						include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-eleven.php');
214 214
 						break;
215 215
 					case 'twentytwelve':
216
-						include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-twelve.php' );
216
+						include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-twelve.php');
217 217
 						break;
218 218
 					case 'twentythirteen':
219
-						include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-thirteen.php' );
219
+						include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-thirteen.php');
220 220
 						break;
221 221
 					case 'twentyfourteen':
222
-						include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-fourteen.php' );
222
+						include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-fourteen.php');
223 223
 						break;
224 224
 					case 'twentyfifteen':
225
-						include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-fifteen.php' );
225
+						include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-fifteen.php');
226 226
 						break;
227 227
 					case 'twentysixteen':
228
-						include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-sixteen.php' );
228
+						include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-sixteen.php');
229 229
 						break;
230 230
 					case 'twentyseventeen':
231
-						include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-seventeen.php' );
231
+						include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-seventeen.php');
232 232
 						break;
233 233
 					case 'storefront':
234
-						include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-storefront.php' );
234
+						include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-storefront.php');
235 235
 						break;
236 236
 					case 'understrap':
237
-						include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-understrap.php' );
237
+						include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-understrap.php');
238 238
 						break;
239 239
 					case 'make':
240
-						include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-make.php' );
240
+						include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-make.php');
241 241
 						break;
242 242
 				} // END switch()
243 243
 
244
-				include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-theme-support.php' );
244
+				include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-theme-support.php');
245 245
 
246 246
 			}
247 247
 		} // END alnp_include_theme_support()
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 		 * @return  void
263 263
 		 */
264 264
 		public function load_plugin_textdomain() {
265
-			load_plugin_textdomain( 'auto-load-next-post', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
265
+			load_plugin_textdomain('auto-load-next-post', false, dirname(plugin_basename(__FILE__)).'/languages/');
266 266
 		} // END load_plugin_textdomain()
267 267
 
268 268
 		/**
@@ -274,32 +274,32 @@  discard block
 block discarded – undo
274 274
 		 */
275 275
 		public function alnp_enqueue_scripts() {
276 276
 			// Load the Javascript if found as a singluar post and the user is not a bot.
277
-			if ( !alnp_is_bot() && is_singular() && get_post_type() == 'post' ) {
277
+			if ( ! alnp_is_bot() && is_singular() && get_post_type() == 'post') {
278 278
 				// This helps the plugin decide to load the JavaScript in the footer or not.
279
-				$load_in_footer = get_option( 'auto_load_next_post_js_footer' );
279
+				$load_in_footer = get_option('auto_load_next_post_js_footer');
280 280
 
281
-				$this->load_file( 'auto-load-next-post-scrollspy', '/assets/js/libs/scrollspy.min.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer );
281
+				$this->load_file('auto-load-next-post-scrollspy', '/assets/js/libs/scrollspy.min.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer);
282 282
 
283 283
 				// Only load History.js when not in the customizer.
284
-				if ( ! is_customize_preview() ) {
285
-					$this->load_file( 'auto-load-next-post-history', '/assets/js/libs/jquery.history.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer );
284
+				if ( ! is_customize_preview()) {
285
+					$this->load_file('auto-load-next-post-history', '/assets/js/libs/jquery.history.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer);
286 286
 				}
287 287
 
288
-				$this->load_file( 'auto-load-next-post-script', '/assets/js/frontend/auto-load-next-post' . AUTO_LOAD_NEXT_POST_DEBUG_MODE.AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.js', true, array('auto-load-next-post-scrollspy'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer );
288
+				$this->load_file('auto-load-next-post-script', '/assets/js/frontend/auto-load-next-post'.AUTO_LOAD_NEXT_POST_DEBUG_MODE.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('auto-load-next-post-scrollspy'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer);
289 289
 
290 290
 				// Variables for the JavaScript
291
-				wp_localize_script( 'auto-load-next-post-script', 'auto_load_next_post_params', array(
291
+				wp_localize_script('auto-load-next-post-script', 'auto_load_next_post_params', array(
292 292
 					'alnp_version'              => AUTO_LOAD_NEXT_POST_VERSION,
293
-					'alnp_content_container'    => get_option( 'auto_load_next_post_content_container' ),
294
-					'alnp_title_selector'       => get_option( 'auto_load_next_post_title_selector' ),
295
-					'alnp_navigation_container' => get_option( 'auto_load_next_post_navigation_container' ),
296
-					'alnp_comments_container'   => get_option( 'auto_load_next_post_comments_container' ),
297
-					'alnp_remove_comments'      => get_option( 'auto_load_next_post_remove_comments' ),
298
-					'alnp_google_analytics'     => get_option( 'auto_load_next_post_google_analytics' ),
299
-					'alnp_event_on_load'        => get_option( 'auto_load_next_post_on_load_event' ),
300
-					'alnp_event_on_entering'    => get_option( 'auto_load_next_post_on_entering_event' ),
293
+					'alnp_content_container'    => get_option('auto_load_next_post_content_container'),
294
+					'alnp_title_selector'       => get_option('auto_load_next_post_title_selector'),
295
+					'alnp_navigation_container' => get_option('auto_load_next_post_navigation_container'),
296
+					'alnp_comments_container'   => get_option('auto_load_next_post_comments_container'),
297
+					'alnp_remove_comments'      => get_option('auto_load_next_post_remove_comments'),
298
+					'alnp_google_analytics'     => get_option('auto_load_next_post_google_analytics'),
299
+					'alnp_event_on_load'        => get_option('auto_load_next_post_on_load_event'),
300
+					'alnp_event_on_entering'    => get_option('auto_load_next_post_on_entering_event'),
301 301
 					'alnp_is_customizer'        => $this->is_alnp_using_customizer(),
302
-				) );
302
+				));
303 303
 			} // END if is_singular() && get_post_type()
304 304
 		} // END alnp_enqueue_scripts()
305 305
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		 * @return string|boolean
317 317
 		 */
318 318
 		public static function is_alnp_using_customizer() {
319
-			if ( is_customize_preview() ) {
319
+			if (is_customize_preview()) {
320 320
 				return "yes";
321 321
 			}
322 322
 
@@ -338,21 +338,21 @@  discard block
 block discarded – undo
338 338
 		 * @param   bool    $footer Optional, can set the JavaScript to load in the footer instead.
339 339
 		 * @global  string  $wp_version
340 340
 		 */
341
-		public static function load_file( $name, $file_path, $is_script = false, $support = array(), $version = '', $footer = false ) {
341
+		public static function load_file($name, $file_path, $is_script = false, $support = array(), $version = '', $footer = false) {
342 342
 			global $wp_version;
343 343
 
344
-			$url = AUTO_LOAD_NEXT_POST_URL_PATH . $file_path; // URL to the file.
344
+			$url = AUTO_LOAD_NEXT_POST_URL_PATH.$file_path; // URL to the file.
345 345
 
346
-			if ( file_exists( AUTO_LOAD_NEXT_POST_FILE_PATH . $file_path ) ) {
347
-				if ( $is_script ) {
348
-					if ( !wp_script_is( $name, 'registered' ) ) {
349
-						wp_register_script( $name, $url, $support, $version, $footer );
350
-						wp_enqueue_script( $name );
346
+			if (file_exists(AUTO_LOAD_NEXT_POST_FILE_PATH.$file_path)) {
347
+				if ($is_script) {
348
+					if ( ! wp_script_is($name, 'registered')) {
349
+						wp_register_script($name, $url, $support, $version, $footer);
350
+						wp_enqueue_script($name);
351 351
 					}
352 352
 				} else {
353
-					if ( !wp_style_is( $name, 'registered' ) ) {
354
-						wp_register_style( $name, $url );
355
-						wp_enqueue_style( $name );
353
+					if ( ! wp_style_is($name, 'registered')) {
354
+						wp_register_style($name, $url);
355
+						wp_enqueue_style($name);
356 356
 					}
357 357
 				} // end if
358 358
 			} // end if
Please login to merge, or discard this patch.
includes/class-alnp-install.php 1 patch
Spacing   +41 added lines, -41 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( 'Auto_Load_Next_Post_Install' ) ) {
18
+if ( ! class_exists('Auto_Load_Next_Post_Install')) {
19 19
 
20 20
 	class Auto_Load_Next_Post_Install {
21 21
 
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
 		 * @access public
37 37
 		 */
38 38
 		public function __construct() {
39
-			add_action( 'init', array( __CLASS__, 'add_rewrite_endpoint' ), 0 );
40
-			add_action( 'init', array( __CLASS__, 'check_version' ), 5 );
39
+			add_action('init', array(__CLASS__, 'add_rewrite_endpoint'), 0);
40
+			add_action('init', array(__CLASS__, 'check_version'), 5);
41 41
 
42 42
 			// Get plugin version.
43
-			self::$current_version = get_option( 'auto_load_next_post_version' );
43
+			self::$current_version = get_option('auto_load_next_post_version');
44 44
 		} // END __construct()
45 45
 
46 46
 		/**
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 		 * @since  1.4.10
54 54
 		 */
55 55
 		public static function check_version() {
56
-			if ( ! defined( 'IFRAME_REQUEST' ) && version_compare( self::$current_version, AUTO_LOAD_NEXT_POST_VERSION, '<' ) ) {
56
+			if ( ! defined('IFRAME_REQUEST') && version_compare(self::$current_version, AUTO_LOAD_NEXT_POST_VERSION, '<')) {
57 57
 				self::install();
58
-				do_action( 'auto_load_next_post_updated' );
58
+				do_action('auto_load_next_post_updated');
59 59
 			}
60 60
 		} // END check_version()
61 61
 
@@ -68,19 +68,19 @@  discard block
 block discarded – undo
68 68
 		 * @version 1.5.0
69 69
 		 */
70 70
 		public static function install() {
71
-			if ( ! is_blog_installed() ) {
71
+			if ( ! is_blog_installed()) {
72 72
 				return;
73 73
 			}
74 74
 
75 75
 			// Check if we are not already running this routine.
76
-			if ( 'yes' === get_transient( 'alnp_installing' ) ) {
76
+			if ('yes' === get_transient('alnp_installing')) {
77 77
 				return;
78 78
 			}
79 79
 
80 80
 			// If we made it till here nothing is running yet, lets set the transient now for five minutes.
81
-			set_transient( 'alnp_installing', 'yes', MINUTE_IN_SECONDS * 5 );
82
-			if ( ! defined( 'AUTO_LOAD_NEXT_POST_INSTALLING' ) ) {
83
-				define( 'AUTO_LOAD_NEXT_POST_INSTALLING', true );
81
+			set_transient('alnp_installing', 'yes', MINUTE_IN_SECONDS * 5);
82
+			if ( ! defined('AUTO_LOAD_NEXT_POST_INSTALLING')) {
83
+				define('AUTO_LOAD_NEXT_POST_INSTALLING', true);
84 84
 			}
85 85
 
86 86
 			// Add default options.
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
 			// Refresh rewrite rules.
102 102
 			self::flush_rewrite_rules();
103 103
 
104
-			delete_transient( 'alnp_installing' );
104
+			delete_transient('alnp_installing');
105 105
 
106
-			do_action( 'alnp_installed' );
106
+			do_action('alnp_installed');
107 107
 		} // END install()
108 108
 
109 109
 		/**
@@ -115,16 +115,16 @@  discard block
 block discarded – undo
115 115
 		 * @since  1.5.0
116 116
 		 */
117 117
 		private static function set_theme_selectors() {
118
-			if ( is_alnp_supported() ) {
119
-				$content_container    = alnp_get_theme_support( 'content_container' );
120
-				$title_selector       = alnp_get_theme_support( 'title_selector' );
121
-				$navigation_container = alnp_get_theme_support( 'navigation_container' );
122
-				$comments_container   = alnp_get_theme_support( 'comments_container' );
123
-
124
-				if ( ! empty( $content_container ) ) update_option( 'auto_load_next_post_content_container', $content_container );
125
-				if ( ! empty( $title_selector ) ) update_option( 'auto_load_next_post_title_selector', $title_selector );
126
-				if ( ! empty( $navigation_container ) ) update_option( 'auto_load_next_post_navigation_container', $navigation_container );
127
-				if ( ! empty( $comments_container ) ) update_option( 'auto_load_next_post_comments_container', $comments_container );
118
+			if (is_alnp_supported()) {
119
+				$content_container    = alnp_get_theme_support('content_container');
120
+				$title_selector       = alnp_get_theme_support('title_selector');
121
+				$navigation_container = alnp_get_theme_support('navigation_container');
122
+				$comments_container   = alnp_get_theme_support('comments_container');
123
+
124
+				if ( ! empty($content_container)) update_option('auto_load_next_post_content_container', $content_container);
125
+				if ( ! empty($title_selector)) update_option('auto_load_next_post_title_selector', $title_selector);
126
+				if ( ! empty($navigation_container)) update_option('auto_load_next_post_navigation_container', $navigation_container);
127
+				if ( ! empty($comments_container)) update_option('auto_load_next_post_comments_container', $comments_container);
128 128
 			}
129 129
 		} // END set_theme_selectors()
130 130
 
@@ -138,12 +138,12 @@  discard block
 block discarded – undo
138 138
 		 * @since  1.5.0
139 139
 		 */
140 140
 		private static function set_js_in_footer() {
141
-			if ( is_alnp_supported() ) {
142
-				$load_js_in_footer = alnp_get_theme_support( 'load_js_in_footer' );
143
-				$lock_js_in_footer = alnp_get_theme_support( 'lock_js_in_footer' );
141
+			if (is_alnp_supported()) {
142
+				$load_js_in_footer = alnp_get_theme_support('load_js_in_footer');
143
+				$lock_js_in_footer = alnp_get_theme_support('lock_js_in_footer');
144 144
 
145
-				if ( ! empty( $load_js_in_footer ) && $load_js_in_footer == 'yes' ) update_option( 'auto_load_next_post_load_js_in_footer', $load_js_in_footer );
146
-				if ( ! empty( $lock_js_in_footer ) && $lock_js_in_footer == 'yes' ) update_option( 'auto_load_next_post_js_footer_locked', $lock_js_in_footer );
145
+				if ( ! empty($load_js_in_footer) && $load_js_in_footer == 'yes') update_option('auto_load_next_post_load_js_in_footer', $load_js_in_footer);
146
+				if ( ! empty($lock_js_in_footer) && $lock_js_in_footer == 'yes') update_option('auto_load_next_post_js_footer_locked', $lock_js_in_footer);
147 147
 			}
148 148
 		} // END set_js_in_footer()
149 149
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 		 * @static
155 155
 		 */
156 156
 		private static function update_version() {
157
-			update_option( 'auto_load_next_post_version', AUTO_LOAD_NEXT_POST_VERSION );
157
+			update_option('auto_load_next_post_version', AUTO_LOAD_NEXT_POST_VERSION);
158 158
 		} // END update_version()
159 159
 
160 160
 		/**
@@ -166,13 +166,13 @@  discard block
 block discarded – undo
166 166
 		 * @version 1.5.0
167 167
 		 */
168 168
 		public static function set_install_date() {
169
-			$install_date = get_site_option( 'auto_load_next_post_install_date' );
169
+			$install_date = get_site_option('auto_load_next_post_install_date');
170 170
 
171 171
 			// If ALNP was installed before but the install date was not converted to time then convert it.
172
-			if ( ! empty( $install_date ) && !intval( $install_date ) ) {
173
-				update_site_option( 'auto_load_next_post_install_date', strtotime( $install_date ) );
172
+			if ( ! empty($install_date) && ! intval($install_date)) {
173
+				update_site_option('auto_load_next_post_install_date', strtotime($install_date));
174 174
 			} else {
175
-				add_site_option( 'auto_load_next_post_install_date', time() );
175
+				add_site_option('auto_load_next_post_install_date', time());
176 176
 			}
177 177
 		} // END set_install_date()
178 178
 
@@ -188,15 +188,15 @@  discard block
 block discarded – undo
188 188
 		 */
189 189
 		public static function create_options() {
190 190
 			// Include settings so that we can run through defaults
191
-			include_once( dirname( __FILE__ ) . '/admin/class-alnp-admin-settings.php' );
191
+			include_once(dirname(__FILE__).'/admin/class-alnp-admin-settings.php');
192 192
 
193 193
 			$settings = Auto_Load_Next_Post_Admin_Settings::get_settings_pages();
194 194
 
195
-			foreach ( $settings as $section ) {
196
-				foreach ( $section->get_settings() as $value ) {
197
-					if ( isset( $value['default'] ) && isset( $value['id'] ) ) {
198
-						$autoload = isset( $value['autoload'] ) ? (bool) $value['autoload'] : true;
199
-						add_option( $value['id'], $value['default'], '', ( $autoload ? 'yes' : 'no' ) );
195
+			foreach ($settings as $section) {
196
+				foreach ($section->get_settings() as $value) {
197
+					if (isset($value['default']) && isset($value['id'])) {
198
+						$autoload = isset($value['autoload']) ? (bool) $value['autoload'] : true;
199
+						add_option($value['id'], $value['default'], '', ($autoload ? 'yes' : 'no'));
200 200
 					}
201 201
 				}
202 202
 			}
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 		 * @version 1.5.0
212 212
 		 */
213 213
 		public static function add_rewrite_endpoint() {
214
-			add_rewrite_endpoint( 'alnp', EP_PERMALINK | EP_PAGES | EP_ATTACHMENT );
214
+			add_rewrite_endpoint('alnp', EP_PERMALINK | EP_PAGES | EP_ATTACHMENT);
215 215
 		} // END add_rewrite_endpoint()
216 216
 
217 217
 		/**
Please login to merge, or discard this patch.