@@ -10,12 +10,12 @@ |
||
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 | 17 | <div class="block credits"> |
18 | - <h4><?php esc_html_e( 'Created & maintained by', 'auto-load-next-post' ); ?></h4> |
|
18 | + <h4><?php esc_html_e('Created & maintained by', 'auto-load-next-post'); ?></h4> |
|
19 | 19 | <ul> |
20 | 20 | <li> |
21 | 21 | <a href="https://profiles.wordpress.org/sebd86" target="_blank"> |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * The list is in the order to look for the templates that store the content. |
97 | 97 | * |
98 | 98 | * @since 1.6.0 |
99 | - * @return array |
|
99 | + * @return string[] |
|
100 | 100 | */ |
101 | 101 | function alnp_get_locations() { |
102 | 102 | return array( |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @since 1.6.0 |
123 | 123 | * @param string $post_type |
124 | 124 | * @param string $post_format |
125 | - * @return array |
|
125 | + * @return string[] |
|
126 | 126 | */ |
127 | 127 | function alnp_get_templates( $post_type = 'post', $post_format = '' ) { |
128 | 128 | $get_standard = array( |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * @param string $post_type |
220 | 220 | * @param string $post_format |
221 | 221 | * @return string $template |
222 | - */ |
|
222 | + */ |
|
223 | 223 | function alnp_get_template( $post_type = 'post', $post_format = '' ) { |
224 | 224 | if ( ! empty( $post_format ) ) { |
225 | 225 | $template = get_option( 'auto_load_next_post_template_post_' . strtolower( $post_format ) ); |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * @param string $post_type |
246 | 246 | * @param string $post_format |
247 | 247 | * @return array |
248 | - */ |
|
248 | + */ |
|
249 | 249 | function alnp_find_template( $location = '', $post_type, $post_format ) { |
250 | 250 | // Templates to look for based on the post that is loaded. |
251 | 251 | $templates = alnp_get_templates( $post_type, $post_format ); |
@@ -12,11 +12,11 @@ discard block |
||
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 ( ! function_exists( 'alnp_template_redirect' ) ) { |
|
19 | +if ( ! function_exists('alnp_template_redirect')) { |
|
20 | 20 | /** |
21 | 21 | * When the 'alnp' endpoint is used on a singular post it forces |
22 | 22 | * the template redirect to retrieve only the post content. |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | global $wp_query; |
30 | 30 | |
31 | 31 | // If this is not a request for alnp or a singular object then bail. |
32 | - if ( ! isset( $wp_query->query_vars['alnp'] ) || ! is_singular() ) { |
|
32 | + if ( ! isset($wp_query->query_vars['alnp']) || ! is_singular()) { |
|
33 | 33 | return; |
34 | 34 | } |
35 | 35 | |
@@ -38,28 +38,28 @@ discard block |
||
38 | 38 | * If theme does not have a template file for Auto Load Next Post, |
39 | 39 | * the plugin will load a default template. |
40 | 40 | */ |
41 | - $child_path = get_stylesheet_directory() . '/' . AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
42 | - $template_path = get_template_directory() . '/' . AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
41 | + $child_path = get_stylesheet_directory().'/'.AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
42 | + $template_path = get_template_directory().'/'.AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
43 | 43 | $default_path = AUTO_LOAD_NEXT_POST_FILE_PATH; |
44 | 44 | $template_redirect = ''; |
45 | 45 | |
46 | - if ( file_exists( $child_path . 'content-alnp.php' ) ) { |
|
47 | - $template_redirect = $child_path . 'content-alnp.php'; |
|
48 | - } else if ( file_exists( $template_path . 'content-alnp.php' ) ) { |
|
49 | - $template_redirect = $template_path . 'content-alnp.php'; |
|
50 | - } else if ( file_exists( $default_path . '/templates/content-alnp.php' ) ) { |
|
51 | - $template_redirect = $default_path . '/templates/content-alnp.php'; |
|
46 | + if (file_exists($child_path.'content-alnp.php')) { |
|
47 | + $template_redirect = $child_path.'content-alnp.php'; |
|
48 | + } else if (file_exists($template_path.'content-alnp.php')) { |
|
49 | + $template_redirect = $template_path.'content-alnp.php'; |
|
50 | + } else if (file_exists($default_path.'/templates/content-alnp.php')) { |
|
51 | + $template_redirect = $default_path.'/templates/content-alnp.php'; |
|
52 | 52 | } |
53 | 53 | |
54 | - $template_redirect = apply_filters( 'alnp_template_redirect', $template_redirect ); |
|
54 | + $template_redirect = apply_filters('alnp_template_redirect', $template_redirect); |
|
55 | 55 | |
56 | - include( $template_redirect ); |
|
56 | + include($template_redirect); |
|
57 | 57 | |
58 | 58 | exit; |
59 | 59 | } // END alnp_template_redirect() |
60 | 60 | } |
61 | 61 | |
62 | -if ( ! function_exists( 'auto_load_next_post_comments' ) ) { |
|
62 | +if ( ! function_exists('auto_load_next_post_comments')) { |
|
63 | 63 | /** |
64 | 64 | * Adds the comments template after the post content. |
65 | 65 | * |
@@ -68,13 +68,13 @@ discard block |
||
68 | 68 | */ |
69 | 69 | function auto_load_next_post_comments() { |
70 | 70 | // If comments are open or we have at least one comment, load up the comment template. |
71 | - if ( comments_open() || get_comments_number() ) : |
|
71 | + if (comments_open() || get_comments_number()) : |
|
72 | 72 | comments_template(); |
73 | 73 | endif; |
74 | 74 | } // END auto_load_next_post_comments() |
75 | 75 | } |
76 | 76 | |
77 | -if ( ! function_exists( 'auto_load_next_post_navigation' ) ) { |
|
77 | +if ( ! function_exists('auto_load_next_post_navigation')) { |
|
78 | 78 | /** |
79 | 79 | * Adds the post navigation for the previous link only after the post content. |
80 | 80 | * |
@@ -84,13 +84,13 @@ discard block |
||
84 | 84 | function auto_load_next_post_navigation() { |
85 | 85 | ?> |
86 | 86 | <nav class="navigation post-navigation" role="navigation"> |
87 | - <span class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'auto-load-next-post' ) . '</span> %title' ); ?></span> |
|
87 | + <span class="nav-previous"><?php previous_post_link('%link', '<span class="meta-nav">'._x('←', 'Previous post link', 'auto-load-next-post').'</span> %title'); ?></span> |
|
88 | 88 | </nav> |
89 | 89 | <?php |
90 | 90 | } // END auto_load_next_post_navigation() |
91 | 91 | } |
92 | 92 | |
93 | -if ( ! function_exists( 'alnp_get_locations' ) ) { |
|
93 | +if ( ! function_exists('alnp_get_locations')) { |
|
94 | 94 | /** |
95 | 95 | * Get list of locations as to where the content for the theme is located. |
96 | 96 | * The list is in the order to look for the templates that store the content. |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | } // END alnp_get_locations() |
116 | 116 | } |
117 | 117 | |
118 | -if ( ! function_exists( 'alnp_get_templates' ) ) { |
|
118 | +if ( ! function_exists('alnp_get_templates')) { |
|
119 | 119 | /** |
120 | 120 | * Get list of templates to look for. |
121 | 121 | * |
@@ -124,28 +124,28 @@ discard block |
||
124 | 124 | * @param string $post_format |
125 | 125 | * @return array |
126 | 126 | */ |
127 | - function alnp_get_templates( $post_type = 'post', $post_format = '' ) { |
|
127 | + function alnp_get_templates($post_type = 'post', $post_format = '') { |
|
128 | 128 | $get_standard = array( |
129 | 129 | 'content-single.php', |
130 | 130 | 'content-post.php', |
131 | - 'content-' . $post_type . '.php', |
|
131 | + 'content-'.$post_type.'.php', |
|
132 | 132 | 'content.php' |
133 | 133 | ); |
134 | 134 | |
135 | - if ( ! empty( $post_format ) ) { |
|
135 | + if ( ! empty($post_format)) { |
|
136 | 136 | $get_formats = array( |
137 | - 'format-' . $post_format . '.php', |
|
138 | - 'content' . $post_format . '.php' |
|
137 | + 'format-'.$post_format.'.php', |
|
138 | + 'content'.$post_format.'.php' |
|
139 | 139 | ); |
140 | 140 | |
141 | - return array_merge( $get_standard, $get_formats ); |
|
141 | + return array_merge($get_standard, $get_formats); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | return $get_standard; |
145 | 145 | } // END alnp_get_templates() |
146 | 146 | } |
147 | 147 | |
148 | -if ( ! function_exists( 'alnp_scan_directories' ) ) { |
|
148 | +if ( ! function_exists('alnp_scan_directories')) { |
|
149 | 149 | /** |
150 | 150 | * Scans for the theme template directory depending on the post type requested and saves it. |
151 | 151 | * |
@@ -153,31 +153,31 @@ discard block |
||
153 | 153 | * @param string $post_type |
154 | 154 | * @param string $post_format |
155 | 155 | */ |
156 | - function alnp_scan_directories( $post_type = 'post', $post_format = '' ) { |
|
156 | + function alnp_scan_directories($post_type = 'post', $post_format = '') { |
|
157 | 157 | // Possible locations where the content files are found. |
158 | 158 | $locations = alnp_get_locations(); |
159 | 159 | |
160 | 160 | // Templates to look for based on the post that is loaded. |
161 | - $templates = alnp_get_templates( $post_type, $post_format ); |
|
161 | + $templates = alnp_get_templates($post_type, $post_format); |
|
162 | 162 | |
163 | 163 | $content_found = false; |
164 | 164 | |
165 | 165 | // Scanning all possible locations. |
166 | - foreach( $locations as $location ) { |
|
166 | + foreach ($locations as $location) { |
|
167 | 167 | // Scanning all possible templates within the locations. |
168 | - foreach( $templates as $template ) { |
|
168 | + foreach ($templates as $template) { |
|
169 | 169 | // Remove forwardslash if location is the parent theme folder. |
170 | - if ( empty( $location ) ) { |
|
170 | + if (empty($location)) { |
|
171 | 171 | $location = str_replace('/', '', $location); |
172 | 172 | } |
173 | 173 | |
174 | 174 | // If a template has been found then save it. |
175 | - if ( locate_template( $location . $template ) != '' && $content_found !== true ) { |
|
175 | + if (locate_template($location.$template) != '' && $content_found !== true) { |
|
176 | 176 | // Save template found. |
177 | - if ( ! empty( $post_format ) ) { |
|
178 | - update_option( 'auto_load_next_post_directory_post_' . $post_format, $location ); |
|
177 | + if ( ! empty($post_format)) { |
|
178 | + update_option('auto_load_next_post_directory_post_'.$post_format, $location); |
|
179 | 179 | } else { |
180 | - update_option( 'auto_load_next_post_directory_' . $post_type, $location ); |
|
180 | + update_option('auto_load_next_post_directory_'.$post_type, $location); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | $content_found = true; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } // END alnp_scan_directories() |
188 | 188 | } |
189 | 189 | |
190 | -if ( ! function_exists( 'alnp_get_template_directory' ) ) { |
|
190 | +if ( ! function_exists('alnp_get_template_directory')) { |
|
191 | 191 | /** |
192 | 192 | * Returns the template directory saved. |
193 | 193 | * |
@@ -196,14 +196,14 @@ discard block |
||
196 | 196 | * @param string $post_format |
197 | 197 | * @return string $template |
198 | 198 | */ |
199 | - function alnp_get_template_directory( $post_type = 'post', $post_format = '' ) { |
|
200 | - if ( ! empty( $post_format ) ) { |
|
201 | - $template = get_option( 'auto_load_next_post_directory_post_' . $post_format ); |
|
199 | + function alnp_get_template_directory($post_type = 'post', $post_format = '') { |
|
200 | + if ( ! empty($post_format)) { |
|
201 | + $template = get_option('auto_load_next_post_directory_post_'.$post_format); |
|
202 | 202 | } else { |
203 | - $template = get_option( 'auto_load_next_post_directory_' . $post_type ); |
|
203 | + $template = get_option('auto_load_next_post_directory_'.$post_type); |
|
204 | 204 | } |
205 | 205 | |
206 | - if ( !$template ) { |
|
206 | + if ( ! $template) { |
|
207 | 207 | return ''; |
208 | 208 | } |
209 | 209 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | } // END alnp_get_template_directory() |
212 | 212 | } |
213 | 213 | |
214 | -if ( ! function_exists( 'alnp_get_template' ) ) { |
|
214 | +if ( ! function_exists('alnp_get_template')) { |
|
215 | 215 | /** |
216 | 216 | * Returns the template file saved. |
217 | 217 | * |
@@ -220,14 +220,14 @@ discard block |
||
220 | 220 | * @param string $post_format |
221 | 221 | * @return string $template |
222 | 222 | */ |
223 | - function alnp_get_template( $post_type = 'post', $post_format = '' ) { |
|
224 | - if ( ! empty( $post_format ) ) { |
|
225 | - $template = get_option( 'auto_load_next_post_template_post_' . strtolower( $post_format ) ); |
|
223 | + function alnp_get_template($post_type = 'post', $post_format = '') { |
|
224 | + if ( ! empty($post_format)) { |
|
225 | + $template = get_option('auto_load_next_post_template_post_'.strtolower($post_format)); |
|
226 | 226 | } else { |
227 | - $template = get_option( 'auto_load_next_post_template_' . strtolower( $post_type ) ); |
|
227 | + $template = get_option('auto_load_next_post_template_'.strtolower($post_type)); |
|
228 | 228 | } |
229 | 229 | |
230 | - if ( !$template ) { |
|
230 | + if ( ! $template) { |
|
231 | 231 | return ''; |
232 | 232 | } |
233 | 233 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | } // END alnp_get_template() |
236 | 236 | } |
237 | 237 | |
238 | -if ( ! function_exists( 'alnp_find_template' ) ) { |
|
238 | +if ( ! function_exists('alnp_find_template')) { |
|
239 | 239 | /** |
240 | 240 | * Scans through the active theme to look for the content to load. |
241 | 241 | * If the content is not found then the fallback will be used. |
@@ -246,27 +246,27 @@ discard block |
||
246 | 246 | * @param string $post_format |
247 | 247 | * @return array |
248 | 248 | */ |
249 | - function alnp_find_template( $location = '', $post_type, $post_format ) { |
|
249 | + function alnp_find_template($location = '', $post_type, $post_format) { |
|
250 | 250 | // Templates to look for based on the post that is loaded. |
251 | - $templates = alnp_get_templates( $post_type, $post_format ); |
|
251 | + $templates = alnp_get_templates($post_type, $post_format); |
|
252 | 252 | |
253 | 253 | $found = false; |
254 | 254 | |
255 | 255 | // Scanning all possible templates within the set location. |
256 | - foreach( $templates as $template ) { |
|
256 | + foreach ($templates as $template) { |
|
257 | 257 | // Remove forwardslash if location is the parent theme folder. |
258 | - if ( empty( $location ) ) { |
|
258 | + if (empty($location)) { |
|
259 | 259 | $location = str_replace('/', '', $location); |
260 | 260 | } |
261 | 261 | |
262 | 262 | // If a template has been found then return it. |
263 | - if ( locate_template( $location . $template ) != '' && $found != true ) { |
|
264 | - $file = $location . $template; |
|
263 | + if (locate_template($location.$template) != '' && $found != true) { |
|
264 | + $file = $location.$template; |
|
265 | 265 | |
266 | - if ( ! empty( $post_format ) ) { |
|
267 | - update_option( 'auto_load_next_post_template_post_' . strtolower( $post_format ), $file ); |
|
266 | + if ( ! empty($post_format)) { |
|
267 | + update_option('auto_load_next_post_template_post_'.strtolower($post_format), $file); |
|
268 | 268 | } else { |
269 | - update_option( 'auto_load_next_post_template_' . strtolower( $post_type ), $file ); |
|
269 | + update_option('auto_load_next_post_template_'.strtolower($post_type), $file); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | $found = true; |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | } // END alnp_find_template() |
281 | 281 | } |
282 | 282 | |
283 | -if ( ! function_exists( 'alnp_load_content' ) ) { |
|
283 | +if ( ! function_exists('alnp_load_content')) { |
|
284 | 284 | /** |
285 | 285 | * Loads theme template set either by theme support or setup wizard. |
286 | 286 | * If the content is not found then a fallback template will be used. |
@@ -289,59 +289,59 @@ discard block |
||
289 | 289 | * @param string $post_type |
290 | 290 | * @param string $post_format |
291 | 291 | */ |
292 | - function alnp_load_content( $post_type, $post_format ) { |
|
292 | + function alnp_load_content($post_type, $post_format) { |
|
293 | 293 | // Returns template location for supported themes. |
294 | 294 | $template_location = alnp_template_location(); |
295 | 295 | |
296 | 296 | $content_found = false; |
297 | 297 | |
298 | 298 | // Check and return directory and template if already found. |
299 | - if ( empty( $template_location ) ) { |
|
300 | - $directory = alnp_get_template_directory( $post_type, $post_format ); |
|
299 | + if (empty($template_location)) { |
|
300 | + $directory = alnp_get_template_directory($post_type, $post_format); |
|
301 | 301 | } else { |
302 | 302 | $directory = $template_location; |
303 | 303 | } |
304 | 304 | |
305 | - $template = alnp_get_template( $post_type, $post_format ); |
|
305 | + $template = alnp_get_template($post_type, $post_format); |
|
306 | 306 | |
307 | - if ( ! empty( $directory ) && ! empty( $template ) ) { |
|
308 | - $template = $directory . $template; |
|
307 | + if ( ! empty($directory) && ! empty($template)) { |
|
308 | + $template = $directory.$template; |
|
309 | 309 | $content_found = true; |
310 | 310 | } else { |
311 | 311 | // Possible locations where the content files are found. |
312 | 312 | $locations = alnp_get_locations(); |
313 | 313 | |
314 | 314 | // Scanning all possible locations. |
315 | - foreach( $locations as $location ) { |
|
316 | - $template = alnp_find_template( $directory, $post_type, $post_format ); |
|
315 | + foreach ($locations as $location) { |
|
316 | + $template = alnp_find_template($directory, $post_type, $post_format); |
|
317 | 317 | $content_found = $template['found']; |
318 | 318 | } |
319 | 319 | } |
320 | 320 | |
321 | 321 | // Can be overridden. |
322 | - $content_found = apply_filters( 'alnp_content_found', $content_found ); |
|
322 | + $content_found = apply_filters('alnp_content_found', $content_found); |
|
323 | 323 | |
324 | 324 | // Check if the user has forced the use of the fallback template. |
325 | - $use_fallback = get_option( 'auto_load_next_post_use_fallback' ); |
|
325 | + $use_fallback = get_option('auto_load_next_post_use_fallback'); |
|
326 | 326 | |
327 | 327 | // If content is found then load the template part. |
328 | - if ( $content_found && empty( $use_fallback ) ) { |
|
329 | - locate_template( $template, true, false ); |
|
328 | + if ($content_found && empty($use_fallback)) { |
|
329 | + locate_template($template, true, false); |
|
330 | 330 | } |
331 | 331 | else { |
332 | - do_action( 'alnp_load_content', $post_type ); |
|
332 | + do_action('alnp_load_content', $post_type); |
|
333 | 333 | } |
334 | 334 | } // END alnp_load_content() |
335 | 335 | } |
336 | 336 | |
337 | -if ( ! function_exists( 'alnp_load_fallback_content' ) ) { |
|
337 | +if ( ! function_exists('alnp_load_fallback_content')) { |
|
338 | 338 | /** |
339 | 339 | * Load fallback template should no content file be found. |
340 | 340 | * |
341 | 341 | * @since 1.6.0 |
342 | 342 | * @param string $post_type |
343 | 343 | */ |
344 | - function alnp_load_fallback_content( $post_type ) { |
|
345 | - get_template_part( AUTO_LOAD_NEXT_POST_FILE_PATH . '/templates/content/content', $post_type ); |
|
344 | + function alnp_load_fallback_content($post_type) { |
|
345 | + get_template_part(AUTO_LOAD_NEXT_POST_FILE_PATH.'/templates/content/content', $post_type); |
|
346 | 346 | } // END alnp_load_fallback_content() |
347 | 347 | } |
@@ -327,8 +327,7 @@ |
||
327 | 327 | // If content is found then load the template part. |
328 | 328 | if ( $content_found && empty( $use_fallback ) ) { |
329 | 329 | locate_template( $template, true, false ); |
330 | - } |
|
331 | - else { |
|
330 | + } else { |
|
332 | 331 | do_action( 'alnp_load_content', $post_type ); |
333 | 332 | } |
334 | 333 | } // END alnp_load_content() |
@@ -35,7 +35,7 @@ |
||
35 | 35 | * @access public |
36 | 36 | * @static |
37 | 37 | * @since 1.0 |
38 | - * @param array $plugin Plugin data |
|
38 | + * @param array $plugins Plugin data |
|
39 | 39 | */ |
40 | 40 | public static function init( $plugins ) { |
41 | 41 | ?> |
@@ -10,23 +10,23 @@ discard block |
||
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( 'Connekt_Plugin_Installer' ) ) { |
|
17 | +if ( ! class_exists('Connekt_Plugin_Installer')) { |
|
18 | 18 | |
19 | 19 | class Connekt_Plugin_Installer { |
20 | 20 | |
21 | 21 | public function start() { |
22 | - if ( ! defined( 'CNKT_INSTALLER_PATH' ) ) { |
|
22 | + if ( ! defined('CNKT_INSTALLER_PATH')) { |
|
23 | 23 | // Update this constant to use outside the plugins directory |
24 | - define( 'CNKT_INSTALLER_PATH', plugins_url( '/', __FILE__ ) ); |
|
24 | + define('CNKT_INSTALLER_PATH', plugins_url('/', __FILE__)); |
|
25 | 25 | } |
26 | 26 | |
27 | - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Enqueue scripts and Localize |
|
28 | - add_action( 'wp_ajax_cnkt_plugin_installer', array( $this, 'cnkt_plugin_installer' ) ); // Install plugin |
|
29 | - add_action( 'wp_ajax_cnkt_plugin_activation', array( $this, 'cnkt_plugin_activation' ) ); // Activate plugin |
|
27 | + add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts')); // Enqueue scripts and Localize |
|
28 | + add_action('wp_ajax_cnkt_plugin_installer', array($this, 'cnkt_plugin_installer')); // Install plugin |
|
29 | + add_action('wp_ajax_cnkt_plugin_activation', array($this, 'cnkt_plugin_activation')); // Activate plugin |
|
30 | 30 | } // END start() |
31 | 31 | |
32 | 32 | /** |
@@ -37,18 +37,18 @@ discard block |
||
37 | 37 | * @since 1.0 |
38 | 38 | * @param array $plugin Plugin data |
39 | 39 | */ |
40 | - public static function init( $plugins ) { |
|
40 | + public static function init($plugins) { |
|
41 | 41 | ?> |
42 | 42 | <div class="cnkt-plugin-installer"> |
43 | 43 | <?php |
44 | - require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); |
|
44 | + require_once(ABSPATH.'wp-admin/includes/plugin-install.php'); |
|
45 | 45 | |
46 | - foreach( $plugins as $plugin ) { |
|
46 | + foreach ($plugins as $plugin) { |
|
47 | 47 | $button_classes = 'install button'; |
48 | - $button_text = __( 'Install Now', 'framework' ); |
|
48 | + $button_text = __('Install Now', 'framework'); |
|
49 | 49 | |
50 | - $api = plugins_api( 'plugin_information', array( |
|
51 | - 'slug' => sanitize_file_name( $plugin['slug'] ), |
|
50 | + $api = plugins_api('plugin_information', array( |
|
51 | + 'slug' => sanitize_file_name($plugin['slug']), |
|
52 | 52 | 'fields' => array( |
53 | 53 | 'short_description' => true, |
54 | 54 | 'sections' => false, |
@@ -63,25 +63,25 @@ discard block |
||
63 | 63 | 'icons' => true, |
64 | 64 | 'banners' => true, |
65 | 65 | ), |
66 | - ) ); |
|
66 | + )); |
|
67 | 67 | |
68 | - if ( ! is_wp_error( $api ) ) { // confirm error free |
|
69 | - $main_plugin_file = Connekt_Plugin_Installer::get_plugin_file( $plugin['slug'] ); // Get main plugin file |
|
68 | + if ( ! is_wp_error($api)) { // confirm error free |
|
69 | + $main_plugin_file = Connekt_Plugin_Installer::get_plugin_file($plugin['slug']); // Get main plugin file |
|
70 | 70 | |
71 | - if ( self::check_file_extension( $main_plugin_file ) ) { // check file extension |
|
72 | - if ( is_plugin_active( $main_plugin_file ) ) { |
|
71 | + if (self::check_file_extension($main_plugin_file)) { // check file extension |
|
72 | + if (is_plugin_active($main_plugin_file)) { |
|
73 | 73 | // plugin activation, confirmed! |
74 | 74 | $button_classes = 'button disabled'; |
75 | - $button_text = __( 'Activated', 'framework' ); |
|
75 | + $button_text = __('Activated', 'framework'); |
|
76 | 76 | } else { |
77 | 77 | // It's installed, let's activate it |
78 | 78 | $button_classes = 'activate button button-primary'; |
79 | - $button_text = __( 'Activate', 'framework' ); |
|
79 | + $button_text = __('Activate', 'framework'); |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | 83 | // Send plugin data to template |
84 | - self::render_template( $plugin, $api, $button_text, $button_classes ); |
|
84 | + self::render_template($plugin, $api, $button_text, $button_classes); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | ?> |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @param string $button_text Text for the button |
102 | 102 | * @param string $button_classes Class names for the button |
103 | 103 | */ |
104 | - public static function render_template( $plugin, $api, $button_text, $button_classes ) { |
|
104 | + public static function render_template($plugin, $api, $button_text, $button_classes) { |
|
105 | 105 | ?> |
106 | 106 | <div class="wp-list-table widefat plugin-install"> |
107 | 107 | <div id="the-list"> |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | <div class="plugin-card-top"> |
110 | 110 | <div class="name column-name"> |
111 | 111 | <h3> |
112 | - <a class="thickbox open-plugin-details-modal" href="<?php echo add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => $api->slug, 'TB_iframe' => 'true', 'width' => '772', 'height' => '906' ), admin_url('plugin-install.php') ); ?>"> |
|
112 | + <a class="thickbox open-plugin-details-modal" href="<?php echo add_query_arg(array('tab' => 'plugin-information', 'plugin' => $api->slug, 'TB_iframe' => 'true', 'width' => '772', 'height' => '906'), admin_url('plugin-install.php')); ?>"> |
|
113 | 113 | <?php echo $api->name; ?> |
114 | 114 | <img class="plugin-icon" src="<?php echo $api->icons['2x']; ?>" alt="<?php echo $api->name; ?>"> |
115 | 115 | </a> |
@@ -120,15 +120,15 @@ discard block |
||
120 | 120 | <p><?php echo $api->short_description; ?></p> |
121 | 121 | <p class="authors"> |
122 | 122 | <cite> |
123 | - <?php printf( __( 'By %s', 'framework' ), $api->author ); ?> |
|
123 | + <?php printf(__('By %s', 'framework'), $api->author); ?> |
|
124 | 124 | </cite> |
125 | 125 | </p> |
126 | 126 | </div> |
127 | 127 | </div> |
128 | 128 | |
129 | 129 | <div class="plugin-card-bottom"> |
130 | - <a class="<?php echo $button_classes; ?>" data-slug="<?php echo $api->slug; ?>" data-name="<?php echo $api->name; ?>" href="<?php echo add_query_arg( array( 'action' => 'install-plugin', 'plugin' => $api->slug, '_wpnonce' => wp_create_nonce( 'install-plugin_' . $api->slug ) ), admin_url( 'update.php' ) ); ?>" aria-label="<?php echo sprintf( esc_html__( 'Install %1$s %2$s now', 'framework' ), $api->name, $api->version ); ?>"><?php echo $button_text; ?></a> |
|
131 | - <a class="button thickbox open-plugin-details-modal" href="<?php echo add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => $api->slug, 'TB_iframe' => 'true', 'width' => '772', 'height' => '906' ), admin_url('plugin-install.php') ); ?>" aria-label="<?php echo sprintf( esc_html__( 'More information about %s', 'framework' ), $api->name ); ?>" data-title="<?php echo $api->name; ?>"><?php _e( 'More Details', 'frameworks' ); ?></a> |
|
130 | + <a class="<?php echo $button_classes; ?>" data-slug="<?php echo $api->slug; ?>" data-name="<?php echo $api->name; ?>" href="<?php echo add_query_arg(array('action' => 'install-plugin', 'plugin' => $api->slug, '_wpnonce' => wp_create_nonce('install-plugin_'.$api->slug)), admin_url('update.php')); ?>" aria-label="<?php echo sprintf(esc_html__('Install %1$s %2$s now', 'framework'), $api->name, $api->version); ?>"><?php echo $button_text; ?></a> |
|
131 | + <a class="button thickbox open-plugin-details-modal" href="<?php echo add_query_arg(array('tab' => 'plugin-information', 'plugin' => $api->slug, 'TB_iframe' => 'true', 'width' => '772', 'height' => '906'), admin_url('plugin-install.php')); ?>" aria-label="<?php echo sprintf(esc_html__('More information about %s', 'framework'), $api->name); ?>" data-title="<?php echo $api->name; ?>"><?php _e('More Details', 'frameworks'); ?></a> |
|
132 | 132 | </div> |
133 | 133 | </div> |
134 | 134 | </div> |
@@ -145,26 +145,26 @@ discard block |
||
145 | 145 | * @return $json |
146 | 146 | */ |
147 | 147 | public function cnkt_plugin_installer() { |
148 | - if ( ! current_user_can( 'install_plugins' ) ) { |
|
149 | - wp_die( __( 'Sorry, you are not allowed to install plugins on this site.', 'framework' ) ); |
|
148 | + if ( ! current_user_can('install_plugins')) { |
|
149 | + wp_die(__('Sorry, you are not allowed to install plugins on this site.', 'framework')); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | $nonce = $_POST["nonce"]; |
153 | 153 | $plugin = $_POST["plugin"]; |
154 | 154 | |
155 | 155 | // Check our nonce, if they don't match then bounce! |
156 | - if ( ! wp_verify_nonce( $nonce, 'cnkt_installer_nonce' ) ) { |
|
157 | - wp_die( __( 'Error - unable to verify nonce, please try again.', 'framework' ) ); |
|
156 | + if ( ! wp_verify_nonce($nonce, 'cnkt_installer_nonce')) { |
|
157 | + wp_die(__('Error - unable to verify nonce, please try again.', 'framework')); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | // Include required libs for installation |
161 | - require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); |
|
162 | - require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); |
|
163 | - require_once( ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php' ); |
|
164 | - require_once( ABSPATH . 'wp-admin/includes/class-plugin-upgrader.php' ); |
|
161 | + require_once(ABSPATH.'wp-admin/includes/plugin-install.php'); |
|
162 | + require_once(ABSPATH.'wp-admin/includes/class-wp-upgrader.php'); |
|
163 | + require_once(ABSPATH.'wp-admin/includes/class-wp-ajax-upgrader-skin.php'); |
|
164 | + require_once(ABSPATH.'wp-admin/includes/class-plugin-upgrader.php'); |
|
165 | 165 | |
166 | 166 | // Get Plugin Info |
167 | - $api = plugins_api( 'plugin_information', |
|
167 | + $api = plugins_api('plugin_information', |
|
168 | 168 | array( |
169 | 169 | 'slug' => $plugin, |
170 | 170 | 'fields' => array( |
@@ -185,15 +185,15 @@ discard block |
||
185 | 185 | ); |
186 | 186 | |
187 | 187 | $skin = new WP_Ajax_Upgrader_Skin(); |
188 | - $upgrader = new Plugin_Upgrader( $skin ); |
|
189 | - $upgrader->install( $api->download_link ); |
|
188 | + $upgrader = new Plugin_Upgrader($skin); |
|
189 | + $upgrader->install($api->download_link); |
|
190 | 190 | |
191 | - if ( $api->name ) { |
|
191 | + if ($api->name) { |
|
192 | 192 | $status = 'success'; |
193 | - $msg = sprintf( __( 'Successfully installed the plugin %s.', 'framework' ), '<strong>' . $api->name . '</strong>' ); |
|
193 | + $msg = sprintf(__('Successfully installed the plugin %s.', 'framework'), '<strong>'.$api->name.'</strong>'); |
|
194 | 194 | } else { |
195 | 195 | $status = 'failed'; |
196 | - $msg = sprintf( __( 'There was an error installing the plugin %s.', 'framework' ), '<strong>' . $api->name . '</strong>' ); |
|
196 | + $msg = sprintf(__('There was an error installing the plugin %s.', 'framework'), '<strong>'.$api->name.'</strong>'); |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | $json = array( |
@@ -211,26 +211,26 @@ discard block |
||
211 | 211 | * @since 1.0 |
212 | 212 | * @return $json |
213 | 213 | */ |
214 | - public function cnkt_plugin_activation(){ |
|
215 | - if ( ! current_user_can( 'install_plugins' ) ) { |
|
216 | - wp_die( __( 'Sorry, you are not allowed to activate plugins on this site.', 'framework' ) ); |
|
214 | + public function cnkt_plugin_activation() { |
|
215 | + if ( ! current_user_can('install_plugins')) { |
|
216 | + wp_die(__('Sorry, you are not allowed to activate plugins on this site.', 'framework')); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | $nonce = $_POST["nonce"]; |
220 | 220 | $plugin = $_POST["plugin"]; |
221 | 221 | |
222 | 222 | // Check our nonce, if they don't match then bounce! |
223 | - if ( ! wp_verify_nonce( $nonce, 'cnkt_installer_nonce' ) ) { |
|
224 | - die( __( 'Error - unable to verify nonce, please try again.', 'framework' ) ); |
|
223 | + if ( ! wp_verify_nonce($nonce, 'cnkt_installer_nonce')) { |
|
224 | + die(__('Error - unable to verify nonce, please try again.', 'framework')); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | // Include required libs for activation |
228 | - require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); |
|
229 | - require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); |
|
230 | - require_once( ABSPATH . 'wp-admin/includes/class-plugin-upgrader.php' ); |
|
228 | + require_once(ABSPATH.'wp-admin/includes/plugin-install.php'); |
|
229 | + require_once(ABSPATH.'wp-admin/includes/class-wp-upgrader.php'); |
|
230 | + require_once(ABSPATH.'wp-admin/includes/class-plugin-upgrader.php'); |
|
231 | 231 | |
232 | 232 | // Get Plugin Info |
233 | - $api = plugins_api( 'plugin_information', |
|
233 | + $api = plugins_api('plugin_information', |
|
234 | 234 | array( |
235 | 235 | 'slug' => $plugin, |
236 | 236 | 'fields' => array( |
@@ -250,17 +250,17 @@ discard block |
||
250 | 250 | ) |
251 | 251 | ); |
252 | 252 | |
253 | - if ( $api->name ) { |
|
254 | - $main_plugin_file = Connekt_Plugin_Installer::get_plugin_file( $plugin ); |
|
253 | + if ($api->name) { |
|
254 | + $main_plugin_file = Connekt_Plugin_Installer::get_plugin_file($plugin); |
|
255 | 255 | $status = 'success'; |
256 | 256 | |
257 | - if ( $main_plugin_file ) { |
|
258 | - activate_plugin( $main_plugin_file ); |
|
259 | - $msg = sprintf( __( '%s successfully activated.', 'framework' ), $api->name ); |
|
257 | + if ($main_plugin_file) { |
|
258 | + activate_plugin($main_plugin_file); |
|
259 | + $msg = sprintf(__('%s successfully activated.', 'framework'), $api->name); |
|
260 | 260 | } |
261 | 261 | } else { |
262 | 262 | $status = 'failed'; |
263 | - $msg = sprintf( __( 'There was an error activating %s.', 'framework' ), $api->name ); |
|
263 | + $msg = sprintf(__('There was an error activating %s.', 'framework'), $api->name); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | $json = array( |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | 'msg' => $msg, |
269 | 269 | ); |
270 | 270 | |
271 | - wp_send_json( $json ); |
|
271 | + wp_send_json($json); |
|
272 | 272 | } // END cnkt_plugin_activation() |
273 | 273 | |
274 | 274 | /** |
@@ -280,17 +280,17 @@ discard block |
||
280 | 280 | * @param string $plugin_slug The slug of the plugin |
281 | 281 | * @return $plugin_file |
282 | 282 | */ |
283 | - public static function get_plugin_file( $plugin_slug ) { |
|
284 | - require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); // Load plugin lib |
|
283 | + public static function get_plugin_file($plugin_slug) { |
|
284 | + require_once(ABSPATH.'/wp-admin/includes/plugin.php'); // Load plugin lib |
|
285 | 285 | |
286 | 286 | $plugins = get_plugins(); |
287 | 287 | |
288 | - foreach( $plugins as $plugin_file => $plugin_info ) { |
|
288 | + foreach ($plugins as $plugin_file => $plugin_info) { |
|
289 | 289 | // Get the basename of the plugin e.g. [askismet]/askismet.php |
290 | - $slug = dirname( plugin_basename( $plugin_file ) ); |
|
290 | + $slug = dirname(plugin_basename($plugin_file)); |
|
291 | 291 | |
292 | - if ( $slug ) { |
|
293 | - if ( $slug == $plugin_slug ) { |
|
292 | + if ($slug) { |
|
293 | + if ($slug == $plugin_slug) { |
|
294 | 294 | return $plugin_file; // If $slug = $plugin_name |
295 | 295 | } |
296 | 296 | } |
@@ -306,8 +306,8 @@ discard block |
||
306 | 306 | * @param string $filename The filename of the plugin |
307 | 307 | * @return boolean |
308 | 308 | */ |
309 | - public static function check_file_extension( $filename ) { |
|
310 | - if ( substr( strrchr( $filename, '.' ), 1 ) === 'php' ) { |
|
309 | + public static function check_file_extension($filename) { |
|
310 | + if (substr(strrchr($filename, '.'), 1) === 'php') { |
|
311 | 311 | // has .php exension |
312 | 312 | return true; |
313 | 313 | } else { |
@@ -325,18 +325,18 @@ discard block |
||
325 | 325 | */ |
326 | 326 | public function enqueue_scripts() { |
327 | 327 | // Thickbox |
328 | - wp_enqueue_script( 'thickbox' ); |
|
329 | - wp_enqueue_style( 'thickbox' ); |
|
330 | - |
|
331 | - wp_enqueue_script( 'plugin-installer', CNKT_INSTALLER_PATH. 'assets/installer.js', array( 'jquery' )); |
|
332 | - wp_localize_script( 'plugin-installer', 'cnkt_installer_localize', array( |
|
333 | - 'ajax_url' => admin_url( 'admin-ajax.php' ), |
|
334 | - 'admin_nonce' => wp_create_nonce( 'cnkt_installer_nonce' ), |
|
335 | - 'install_now' => __( 'Are you sure you want to install this plugin?', 'framework' ), |
|
336 | - 'install_btn' => __( 'Install Now', 'framework' ), |
|
337 | - 'activate_btn' => __( 'Activate', 'framework' ), |
|
338 | - 'installed_btn' => __( 'Activated', 'framework' ) |
|
339 | - ) ); |
|
328 | + wp_enqueue_script('thickbox'); |
|
329 | + wp_enqueue_style('thickbox'); |
|
330 | + |
|
331 | + wp_enqueue_script('plugin-installer', CNKT_INSTALLER_PATH.'assets/installer.js', array('jquery')); |
|
332 | + wp_localize_script('plugin-installer', 'cnkt_installer_localize', array( |
|
333 | + 'ajax_url' => admin_url('admin-ajax.php'), |
|
334 | + 'admin_nonce' => wp_create_nonce('cnkt_installer_nonce'), |
|
335 | + 'install_now' => __('Are you sure you want to install this plugin?', 'framework'), |
|
336 | + 'install_btn' => __('Install Now', 'framework'), |
|
337 | + 'activate_btn' => __('Activate', 'framework'), |
|
338 | + 'installed_btn' => __('Activated', 'framework') |
|
339 | + )); |
|
340 | 340 | } |
341 | 341 | } // END enqueue_scripts() |
342 | 342 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * The main instance of the plugin. |
27 | 27 | */ |
28 | -if ( ! class_exists( 'Auto_Load_Next_Post' ) ) { |
|
28 | +if ( ! class_exists('Auto_Load_Next_Post')) { |
|
29 | 29 | |
30 | 30 | class Auto_Load_Next_Post { |
31 | 31 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @return Auto_Load_Next_Post Single instance. |
60 | 60 | */ |
61 | 61 | public static function instance() { |
62 | - if ( is_null( self::$_instance ) ) { |
|
62 | + if (is_null(self::$_instance)) { |
|
63 | 63 | self::$_instance = new self(); |
64 | 64 | } |
65 | 65 | return self::$_instance; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function __clone() { |
76 | 76 | // Cloning instances of the class is forbidden |
77 | - _doing_it_wrong( __FUNCTION__, __( 'Cloning this object is forbidden.', 'auto-load-next-post' ), self::$version ); |
|
77 | + _doing_it_wrong(__FUNCTION__, __('Cloning this object is forbidden.', 'auto-load-next-post'), self::$version); |
|
78 | 78 | } // END __clone() |
79 | 79 | |
80 | 80 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @return void |
86 | 86 | */ |
87 | 87 | public function __wakeup() { |
88 | - _doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'auto-load-next-post' ), self::$version ); |
|
88 | + _doing_it_wrong(__FUNCTION__, __('Unserializing instances of this class is forbidden.', 'auto-load-next-post'), self::$version); |
|
89 | 89 | } // END __wakeup() |
90 | 90 | |
91 | 91 | /** |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $this->init_hooks(); |
102 | 102 | |
103 | 103 | // Auto Load Next Post is fully loaded. |
104 | - do_action( 'auto_load_next_post_loaded' ); |
|
104 | + do_action('auto_load_next_post_loaded'); |
|
105 | 105 | } // END __construct() |
106 | 106 | |
107 | 107 | /** |
@@ -112,10 +112,10 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function init_hooks() { |
114 | 114 | // Load translation files. |
115 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
115 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
116 | 116 | |
117 | 117 | // Load Auto Load Next Post scripts on the frontend. |
118 | - add_action( 'wp_enqueue_scripts', array( $this, 'alnp_enqueue_scripts' ) ); |
|
118 | + add_action('wp_enqueue_scripts', array($this, 'alnp_enqueue_scripts')); |
|
119 | 119 | } // END init_hooks() |
120 | 120 | |
121 | 121 | /** |
@@ -130,10 +130,10 @@ discard block |
||
130 | 130 | $this->define('AUTO_LOAD_NEXT_POST_FILE', __FILE__); |
131 | 131 | $this->define('AUTO_LOAD_NEXT_POST_SLUG', 'auto-load-next-post'); |
132 | 132 | |
133 | - $this->define('AUTO_LOAD_NEXT_POST_URL_PATH', untrailingslashit( plugins_url( '/', __FILE__ ) ) ); |
|
134 | - $this->define('AUTO_LOAD_NEXT_POST_FILE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); |
|
133 | + $this->define('AUTO_LOAD_NEXT_POST_URL_PATH', untrailingslashit(plugins_url('/', __FILE__))); |
|
134 | + $this->define('AUTO_LOAD_NEXT_POST_FILE_PATH', untrailingslashit(plugin_dir_path(__FILE__))); |
|
135 | 135 | $this->define('AUTO_LOAD_NEXT_POST_TEMPLATE_PATH', 'auto-load-next-post/'); |
136 | - $this->define('AUTO_LOAD_NEXT_POST_3RD_PARTY', AUTO_LOAD_NEXT_POST_FILE_PATH . '/includes/3rd-party/'); |
|
136 | + $this->define('AUTO_LOAD_NEXT_POST_3RD_PARTY', AUTO_LOAD_NEXT_POST_FILE_PATH.'/includes/3rd-party/'); |
|
137 | 137 | |
138 | 138 | $this->define('AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE', '4.4'); |
139 | 139 | |
@@ -158,9 +158,9 @@ discard block |
||
158 | 158 | * @param string $name |
159 | 159 | * @param string|bool $value |
160 | 160 | */ |
161 | - private function define( $name, $value ) { |
|
162 | - if ( ! defined( $name ) ) { |
|
163 | - define( $name, $value ); |
|
161 | + private function define($name, $value) { |
|
162 | + if ( ! defined($name)) { |
|
163 | + define($name, $value); |
|
164 | 164 | } |
165 | 165 | } // END define() |
166 | 166 | |
@@ -173,35 +173,35 @@ discard block |
||
173 | 173 | * @return void |
174 | 174 | */ |
175 | 175 | public function includes() { |
176 | - include_once( dirname( __FILE__ ) . '/includes/class-alnp-autoloader.php' ); // Autoloader. |
|
177 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-deprecated-functions.php' ); // Deprecated functions. |
|
178 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-conditional-functions.php' ); // Conditional functions. |
|
179 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-formatting-functions.php' ); // Formatting functions. |
|
180 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-themes-supported.php' ); // Handles all supported themes out of the box. |
|
181 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-core-functions.php' ); // Contains core functions for the front/back end. |
|
182 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-template-functions.php' ); // Template Functions |
|
183 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-template-hooks.php' ); // Template Hooks |
|
176 | + include_once(dirname(__FILE__).'/includes/class-alnp-autoloader.php'); // Autoloader. |
|
177 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-deprecated-functions.php'); // Deprecated functions. |
|
178 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-conditional-functions.php'); // Conditional functions. |
|
179 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-formatting-functions.php'); // Formatting functions. |
|
180 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-themes-supported.php'); // Handles all supported themes out of the box. |
|
181 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-core-functions.php'); // Contains core functions for the front/back end. |
|
182 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-template-functions.php'); // Template Functions |
|
183 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-template-hooks.php'); // Template Hooks |
|
184 | 184 | |
185 | 185 | // Include theme support. |
186 | 186 | alnp_include_theme_support(); |
187 | 187 | |
188 | 188 | // 3rd Party support. |
189 | - include_once( dirname( __FILE__ ) . '/includes/3rd-party/3rd-party.php' ); |
|
189 | + include_once(dirname(__FILE__).'/includes/3rd-party/3rd-party.php'); |
|
190 | 190 | |
191 | 191 | // Customizer. |
192 | - include_once( dirname( __FILE__ ) . '/includes/customizer/class-alnp-customizer.php' ); |
|
193 | - include_once( dirname( __FILE__ ) . '/includes/customizer/class-alnp-customizer-scripts.php' ); |
|
192 | + include_once(dirname(__FILE__).'/includes/customizer/class-alnp-customizer.php'); |
|
193 | + include_once(dirname(__FILE__).'/includes/customizer/class-alnp-customizer-scripts.php'); |
|
194 | 194 | |
195 | 195 | // Ajax |
196 | - include_once( dirname( __FILE__ ) . '/includes/class-alnp-ajax.php' ); |
|
196 | + include_once(dirname(__FILE__).'/includes/class-alnp-ajax.php'); |
|
197 | 197 | |
198 | 198 | // Include admin class to handle all back-end functions. |
199 | - if ( is_admin() ) { |
|
200 | - include_once( dirname( __FILE__ ) . '/includes/admin/class-alnp-admin.php' ); |
|
199 | + if (is_admin()) { |
|
200 | + include_once(dirname(__FILE__).'/includes/admin/class-alnp-admin.php'); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | // Install. |
204 | - require_once( dirname( __FILE__ ) . '/includes/class-alnp-install.php' ); |
|
204 | + require_once(dirname(__FILE__).'/includes/class-alnp-install.php'); |
|
205 | 205 | } // END includes() |
206 | 206 | |
207 | 207 | /** |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | * @return void |
217 | 217 | */ |
218 | 218 | public function load_plugin_textdomain() { |
219 | - load_plugin_textdomain( 'auto-load-next-post', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); |
|
219 | + load_plugin_textdomain('auto-load-next-post', false, dirname(plugin_basename(__FILE__)).'/languages/'); |
|
220 | 220 | } // END load_plugin_textdomain() |
221 | 221 | |
222 | 222 | /** |
@@ -228,43 +228,43 @@ discard block |
||
228 | 228 | */ |
229 | 229 | public function alnp_enqueue_scripts() { |
230 | 230 | // Prevent enqueue scripts if feed, trackback or a preview of a post. |
231 | - if ( is_feed() || is_trackback() || is_preview() ) { |
|
231 | + if (is_feed() || is_trackback() || is_preview()) { |
|
232 | 232 | return; |
233 | 233 | } |
234 | 234 | |
235 | 235 | // Load the Javascript if found as a singluar post and the user is not a bot. |
236 | - if ( ! alnp_is_bot() && is_singular() && get_post_type() == 'post' ) { |
|
236 | + if ( ! alnp_is_bot() && is_singular() && get_post_type() == 'post') { |
|
237 | 237 | // This checks to see if the JavaScript should load in the footer or not. |
238 | 238 | $load_in_footer = alnp_load_js_in_footer(); |
239 | 239 | |
240 | 240 | // This checks to see if we should disable Auto Load Next Post from running on mobile devices. |
241 | 241 | $disable_mobile = alnp_disable_on_mobile(); |
242 | 242 | |
243 | - $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 ); |
|
243 | + $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); |
|
244 | 244 | |
245 | 245 | // Only load History.js when not in the customizer. |
246 | - if ( ! is_customize_preview() ) { |
|
247 | - $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 ); |
|
246 | + if ( ! is_customize_preview()) { |
|
247 | + $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); |
|
248 | 248 | } |
249 | 249 | |
250 | - $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 ); |
|
250 | + $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); |
|
251 | 251 | |
252 | 252 | // Variables for the JavaScript |
253 | - wp_localize_script( 'auto-load-next-post-script', 'auto_load_next_post_params', array( |
|
253 | + wp_localize_script('auto-load-next-post-script', 'auto_load_next_post_params', array( |
|
254 | 254 | 'alnp_version' => AUTO_LOAD_NEXT_POST_VERSION, |
255 | - 'alnp_content_container' => get_option( 'auto_load_next_post_content_container' ), |
|
256 | - 'alnp_title_selector' => get_option( 'auto_load_next_post_title_selector' ), |
|
257 | - 'alnp_navigation_container' => get_option( 'auto_load_next_post_navigation_container' ), |
|
258 | - 'alnp_comments_container' => get_option( 'auto_load_next_post_comments_container' ), |
|
259 | - 'alnp_remove_comments' => get_option( 'auto_load_next_post_remove_comments' ), |
|
260 | - 'alnp_google_analytics' => get_option( 'auto_load_next_post_google_analytics' ), |
|
261 | - 'alnp_event_on_load' => get_option( 'auto_load_next_post_on_load_event' ), |
|
262 | - 'alnp_event_on_entering' => get_option( 'auto_load_next_post_on_entering_event' ), |
|
255 | + 'alnp_content_container' => get_option('auto_load_next_post_content_container'), |
|
256 | + 'alnp_title_selector' => get_option('auto_load_next_post_title_selector'), |
|
257 | + 'alnp_navigation_container' => get_option('auto_load_next_post_navigation_container'), |
|
258 | + 'alnp_comments_container' => get_option('auto_load_next_post_comments_container'), |
|
259 | + 'alnp_remove_comments' => get_option('auto_load_next_post_remove_comments'), |
|
260 | + 'alnp_google_analytics' => get_option('auto_load_next_post_google_analytics'), |
|
261 | + 'alnp_event_on_load' => get_option('auto_load_next_post_on_load_event'), |
|
262 | + 'alnp_event_on_entering' => get_option('auto_load_next_post_on_entering_event'), |
|
263 | 263 | 'alnp_is_customizer' => $this->is_alnp_using_customizer(), |
264 | 264 | 'alnp_load_in_footer' => $load_in_footer, |
265 | 265 | 'alnp_is_mobile' => $this->is_mobile(), |
266 | 266 | 'alnp_disable_mobile' => $disable_mobile |
267 | - ) ); |
|
267 | + )); |
|
268 | 268 | } // END if is_singular() && get_post_type() |
269 | 269 | } // END alnp_enqueue_scripts() |
270 | 270 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | * @return string|bool |
278 | 278 | */ |
279 | 279 | public static function is_alnp_using_customizer() { |
280 | - if ( is_customize_preview() ) { |
|
280 | + if (is_customize_preview()) { |
|
281 | 281 | return "yes"; |
282 | 282 | } |
283 | 283 | |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | * @return string|bool |
294 | 294 | */ |
295 | 295 | public static function is_mobile() { |
296 | - if ( wp_is_mobile() ) { |
|
296 | + if (wp_is_mobile()) { |
|
297 | 297 | return "yes"; |
298 | 298 | } |
299 | 299 | |
@@ -314,19 +314,19 @@ discard block |
||
314 | 314 | * @param string $version Optional, can match the version of the plugin or version of the source file. |
315 | 315 | * @param bool $footer Optional, can set the JavaScript to load in the footer instead. |
316 | 316 | */ |
317 | - public static function load_file( $name, $file_path, $is_script = false, $support = array(), $version = '', $footer = false ) { |
|
318 | - $url = AUTO_LOAD_NEXT_POST_URL_PATH . $file_path; // URL to the file. |
|
319 | - |
|
320 | - if ( file_exists( AUTO_LOAD_NEXT_POST_FILE_PATH . $file_path ) ) { |
|
321 | - if ( $is_script ) { |
|
322 | - if ( !wp_script_is( $name, 'registered' ) ) { |
|
323 | - wp_register_script( $name, $url, $support, $version, $footer ); |
|
324 | - wp_enqueue_script( $name ); |
|
317 | + public static function load_file($name, $file_path, $is_script = false, $support = array(), $version = '', $footer = false) { |
|
318 | + $url = AUTO_LOAD_NEXT_POST_URL_PATH.$file_path; // URL to the file. |
|
319 | + |
|
320 | + if (file_exists(AUTO_LOAD_NEXT_POST_FILE_PATH.$file_path)) { |
|
321 | + if ($is_script) { |
|
322 | + if ( ! wp_script_is($name, 'registered')) { |
|
323 | + wp_register_script($name, $url, $support, $version, $footer); |
|
324 | + wp_enqueue_script($name); |
|
325 | 325 | } |
326 | 326 | } else { |
327 | - if ( !wp_style_is( $name, 'registered' ) ) { |
|
328 | - wp_register_style( $name, $url ); |
|
329 | - wp_enqueue_style( $name ); |
|
327 | + if ( ! wp_style_is($name, 'registered')) { |
|
328 | + wp_register_style($name, $url); |
|
329 | + wp_enqueue_style($name); |
|
330 | 330 | } |
331 | 331 | } // end if |
332 | 332 | } // end if |
@@ -12,13 +12,13 @@ discard block |
||
12 | 12 | ?> |
13 | 13 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
14 | 14 | <header class="entry-header"> |
15 | - <?php the_title( '<h1 class="entry-title h1">', '</h1>' ); ?> |
|
15 | + <?php the_title('<h1 class="entry-title h1">', '</h1>'); ?> |
|
16 | 16 | </header><!-- .entry-header --> |
17 | 17 | |
18 | - <?php if ( has_post_thumbnail() ) : ?> |
|
18 | + <?php if (has_post_thumbnail()) : ?> |
|
19 | 19 | <figure class="post-thumbnail"> |
20 | 20 | <div class="post-thumbnail-inner"> |
21 | - <?php the_post_thumbnail( 'post-thumbnail' ); ?> |
|
21 | + <?php the_post_thumbnail('post-thumbnail'); ?> |
|
22 | 22 | </div> |
23 | 23 | </figure><!-- .post-thumbnail --> |
24 | 24 | <?php endif; ?> |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | wp_link_pages( |
31 | 31 | array( |
32 | - 'before' => '<div class="page-links">' . __( 'Pages:', 'auto-load-next-post' ), |
|
32 | + 'before' => '<div class="page-links">'.__('Pages:', 'auto-load-next-post'), |
|
33 | 33 | 'after' => '</div>', |
34 | 34 | ) |
35 | 35 | ); |
@@ -8,40 +8,40 @@ |
||
8 | 8 | * @version 1.6.0 |
9 | 9 | */ |
10 | 10 | |
11 | -if ( have_posts() ) : |
|
11 | +if (have_posts()) : |
|
12 | 12 | |
13 | 13 | // Load content before the loop. |
14 | - do_action( 'alnp_load_before_loop' ); |
|
14 | + do_action('alnp_load_before_loop'); |
|
15 | 15 | |
16 | 16 | // Check that there are more posts to load. |
17 | - while ( have_posts() ) : the_post(); |
|
17 | + while (have_posts()) : the_post(); |
|
18 | 18 | |
19 | 19 | $post_type = alnp_get_post_type(); // Post Type e.g. single |
20 | 20 | |
21 | 21 | // Load content before the post content. |
22 | - do_action( 'alnp_load_before_content' ); |
|
22 | + do_action('alnp_load_before_content'); |
|
23 | 23 | |
24 | 24 | // Load content before the post content for a specific post type. |
25 | - do_action( 'alnp_load_before_content_post_type_' . $post_type ); |
|
25 | + do_action('alnp_load_before_content_post_type_'.$post_type); |
|
26 | 26 | |
27 | 27 | // Load Make partial template for the correct post type. |
28 | - get_template_part( 'partials/content', $post_type ); |
|
28 | + get_template_part('partials/content', $post_type); |
|
29 | 29 | |
30 | 30 | // Load content after the post content for a specific post type. |
31 | - do_action( 'alnp_load_after_content_post_type_' . $post_type ); |
|
31 | + do_action('alnp_load_after_content_post_type_'.$post_type); |
|
32 | 32 | |
33 | 33 | // Load content before the post content. |
34 | - do_action( 'alnp_load_after_content' ); |
|
34 | + do_action('alnp_load_after_content'); |
|
35 | 35 | |
36 | 36 | // End the loop. |
37 | 37 | endwhile; |
38 | 38 | |
39 | 39 | // Load content after the loop. |
40 | - do_action( 'alnp_load_after_loop' ); |
|
40 | + do_action('alnp_load_after_loop'); |
|
41 | 41 | |
42 | 42 | else : |
43 | 43 | |
44 | 44 | // Load content if there are no more posts. |
45 | - do_action( 'alnp_no_more_posts' ); |
|
45 | + do_action('alnp_no_more_posts'); |
|
46 | 46 | |
47 | 47 | endif; // END if have_posts() |
@@ -8,41 +8,41 @@ |
||
8 | 8 | * @version 1.6.0 |
9 | 9 | */ |
10 | 10 | |
11 | -if ( have_posts() ) : |
|
11 | +if (have_posts()) : |
|
12 | 12 | |
13 | 13 | // Load content before the loop. |
14 | - do_action( 'alnp_load_before_loop' ); |
|
14 | + do_action('alnp_load_before_loop'); |
|
15 | 15 | |
16 | 16 | // Check that there are posts to load. |
17 | - while ( have_posts() ) : the_post(); |
|
17 | + while (have_posts()) : the_post(); |
|
18 | 18 | |
19 | 19 | // Post Type e.g. single |
20 | 20 | $post_type = alnp_get_post_type(); |
21 | 21 | |
22 | 22 | // Load content before the post content. |
23 | - do_action( 'alnp_load_before_content' ); |
|
23 | + do_action('alnp_load_before_content'); |
|
24 | 24 | |
25 | 25 | // Load content before the post content for a specific post type. |
26 | - do_action( 'alnp_load_before_content_post_type_' . $post_type ); |
|
26 | + do_action('alnp_load_before_content_post_type_'.$post_type); |
|
27 | 27 | |
28 | 28 | // Get template for specific post type. |
29 | - include_once( 'content-' . $post_type . '.php' ); |
|
29 | + include_once('content-'.$post_type.'.php'); |
|
30 | 30 | |
31 | 31 | // Load content after the post content for a specific post type. |
32 | - do_action( 'alnp_load_after_content_post_type_' . $post_type ); |
|
32 | + do_action('alnp_load_after_content_post_type_'.$post_type); |
|
33 | 33 | |
34 | 34 | // Load content after the post content. |
35 | - do_action( 'alnp_load_after_content' ); |
|
35 | + do_action('alnp_load_after_content'); |
|
36 | 36 | |
37 | 37 | // End the loop. |
38 | 38 | endwhile; |
39 | 39 | |
40 | 40 | // Load content after the loop. |
41 | - do_action( 'alnp_load_after_loop' ); |
|
41 | + do_action('alnp_load_after_loop'); |
|
42 | 42 | |
43 | 43 | else : |
44 | 44 | |
45 | 45 | // Load content if there are no more posts. |
46 | - do_action( 'alnp_no_more_posts' ); |
|
46 | + do_action('alnp_no_more_posts'); |
|
47 | 47 | |
48 | 48 | endif; // END if have_posts() |
@@ -8,32 +8,32 @@ |
||
8 | 8 | * @version 1.6.0 |
9 | 9 | */ |
10 | 10 | |
11 | -if ( have_posts() ) : |
|
11 | +if (have_posts()) : |
|
12 | 12 | |
13 | 13 | // Load content before the loop. |
14 | - do_action( 'alnp_load_before_loop' ); |
|
14 | + do_action('alnp_load_before_loop'); |
|
15 | 15 | |
16 | 16 | // Check that there are posts to load. |
17 | - while ( have_posts() ) : the_post(); |
|
17 | + while (have_posts()) : the_post(); |
|
18 | 18 | |
19 | 19 | // Load content before the post content. |
20 | - do_action( 'alnp_load_before_content' ); |
|
20 | + do_action('alnp_load_before_content'); |
|
21 | 21 | |
22 | 22 | // Load 'loop-templates/content-single.php' |
23 | - get_template_part( alnp_template_location() . 'content', 'single' ); |
|
23 | + get_template_part(alnp_template_location().'content', 'single'); |
|
24 | 24 | |
25 | 25 | // Load content after the post content. |
26 | - do_action( 'alnp_load_after_content' ); |
|
26 | + do_action('alnp_load_after_content'); |
|
27 | 27 | |
28 | 28 | // End the loop. |
29 | 29 | endwhile; |
30 | 30 | |
31 | 31 | // Load content after the loop. |
32 | - do_action( 'alnp_load_after_loop' ); |
|
32 | + do_action('alnp_load_after_loop'); |
|
33 | 33 | |
34 | 34 | else : |
35 | 35 | |
36 | 36 | // Load content if there are no more posts. |
37 | - do_action( 'alnp_no_more_posts' ); |
|
37 | + do_action('alnp_no_more_posts'); |
|
38 | 38 | |
39 | 39 | endif; // END if have_posts() |
@@ -8,22 +8,22 @@ discard block |
||
8 | 8 | * @version 1.6.0 |
9 | 9 | */ |
10 | 10 | |
11 | -if ( have_posts() ) : |
|
11 | +if (have_posts()) : |
|
12 | 12 | |
13 | 13 | // Load content before the loop. |
14 | - do_action( 'alnp_load_before_loop' ); |
|
14 | + do_action('alnp_load_before_loop'); |
|
15 | 15 | |
16 | 16 | // Check that there are posts to load. |
17 | - while ( have_posts() ) : the_post(); |
|
17 | + while (have_posts()) : the_post(); |
|
18 | 18 | |
19 | 19 | // Load content before the post content. |
20 | - do_action( 'alnp_load_before_content' ); |
|
20 | + do_action('alnp_load_before_content'); |
|
21 | 21 | ?> |
22 | 22 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
23 | 23 | <header class="entry-header"> |
24 | 24 | <h1 class="entry-title"><?php the_title(); ?></h1> |
25 | 25 | |
26 | - <?php if ( 'post' == get_post_type() ) : ?> |
|
26 | + <?php if ('post' == get_post_type()) : ?> |
|
27 | 27 | <div class="entry-meta"> |
28 | 28 | <?php twentyeleven_posted_on(); ?> |
29 | 29 | </div><!-- .entry-meta --> |
@@ -32,49 +32,49 @@ discard block |
||
32 | 32 | |
33 | 33 | <div class="entry-content"> |
34 | 34 | <?php the_content(); ?> |
35 | - <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'auto-load-next-post' ), 'after' => '</div>' ) ); ?> |
|
35 | + <?php wp_link_pages(array('before' => '<div class="page-link">'.__('Pages:', 'auto-load-next-post'), 'after' => '</div>')); ?> |
|
36 | 36 | </div><!-- .entry-content --> |
37 | 37 | |
38 | 38 | <footer class="entry-meta"> |
39 | 39 | <?php |
40 | 40 | /* translators: used between list items, there is a space after the comma */ |
41 | - $categories_list = get_the_category_list( __( ', ', 'auto-load-next-post' ) ); |
|
41 | + $categories_list = get_the_category_list(__(', ', 'auto-load-next-post')); |
|
42 | 42 | |
43 | 43 | /* translators: used between list items, there is a space after the comma */ |
44 | - $tag_list = get_the_tag_list( '', __( ', ', 'auto-load-next-post' ) ); |
|
45 | - if ( '' != $tag_list ) { |
|
46 | - $utility_text = __( 'This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'auto-load-next-post' ); |
|
47 | - } elseif ( '' != $categories_list ) { |
|
48 | - $utility_text = __( 'This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'auto-load-next-post' ); |
|
44 | + $tag_list = get_the_tag_list('', __(', ', 'auto-load-next-post')); |
|
45 | + if ('' != $tag_list) { |
|
46 | + $utility_text = __('This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'auto-load-next-post'); |
|
47 | + } elseif ('' != $categories_list) { |
|
48 | + $utility_text = __('This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'auto-load-next-post'); |
|
49 | 49 | } else { |
50 | - $utility_text = __( 'This entry was posted by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'auto-load-next-post' ); |
|
50 | + $utility_text = __('This entry was posted by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'auto-load-next-post'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | printf( |
54 | 54 | $utility_text, |
55 | 55 | $categories_list, |
56 | 56 | $tag_list, |
57 | - esc_url( get_permalink() ), |
|
58 | - the_title_attribute( 'echo=0' ), |
|
57 | + esc_url(get_permalink()), |
|
58 | + the_title_attribute('echo=0'), |
|
59 | 59 | get_the_author(), |
60 | - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) |
|
60 | + esc_url(get_author_posts_url(get_the_author_meta('ID'))) |
|
61 | 61 | ); |
62 | 62 | ?> |
63 | 63 | |
64 | - <?php if ( get_the_author_meta( 'description' ) && ( ! function_exists( 'is_multi_author' ) || is_multi_author() ) ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?> |
|
64 | + <?php if (get_the_author_meta('description') && ( ! function_exists('is_multi_author') || is_multi_author())) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?> |
|
65 | 65 | <div id="author-info"> |
66 | 66 | <div id="author-avatar"> |
67 | 67 | <?php |
68 | 68 | /** This filter is documented in author.php */ |
69 | - echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ) ); |
|
69 | + echo get_avatar(get_the_author_meta('user_email'), apply_filters('twentyeleven_author_bio_avatar_size', 68)); |
|
70 | 70 | ?> |
71 | 71 | </div><!-- #author-avatar --> |
72 | 72 | <div id="author-description"> |
73 | - <h2><?php printf( __( 'About %s', 'auto-load-next-post' ), get_the_author() ); ?></h2> |
|
74 | - <?php the_author_meta( 'description' ); ?> |
|
73 | + <h2><?php printf(__('About %s', 'auto-load-next-post'), get_the_author()); ?></h2> |
|
74 | + <?php the_author_meta('description'); ?> |
|
75 | 75 | <div id="author-link"> |
76 | - <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author"> |
|
77 | - <?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'auto-load-next-post' ), get_the_author() ); ?> |
|
76 | + <a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>" rel="author"> |
|
77 | + <?php printf(__('View all posts by %s <span class="meta-nav">→</span>', 'auto-load-next-post'), get_the_author()); ?> |
|
78 | 78 | </a> |
79 | 79 | </div><!-- #author-link --> |
80 | 80 | </div><!-- #author-description --> |
@@ -84,17 +84,17 @@ discard block |
||
84 | 84 | </article><!-- #post-<?php the_ID(); ?> --> |
85 | 85 | <?php |
86 | 86 | // Load content after the post content. |
87 | - do_action( 'alnp_load_after_content' ); |
|
87 | + do_action('alnp_load_after_content'); |
|
88 | 88 | |
89 | 89 | // End the loop. |
90 | 90 | endwhile; |
91 | 91 | |
92 | 92 | // Load content after the loop. |
93 | - do_action( 'alnp_load_after_loop' ); |
|
93 | + do_action('alnp_load_after_loop'); |
|
94 | 94 | |
95 | 95 | else : |
96 | 96 | |
97 | 97 | // Load content if there are no more posts. |
98 | - do_action( 'alnp_no_more_posts' ); |
|
98 | + do_action('alnp_no_more_posts'); |
|
99 | 99 | |
100 | 100 | endif; // END if have_posts() |