@@ -46,25 +46,25 @@ discard block |
||
46 | 46 | * @param array $requirements Minimum and Recommended version of PHP. |
47 | 47 | */ |
48 | 48 | public function __construct($plugin = array(), $requirements = array()) { |
49 | - if ( is_array($plugin) && !empty($plugin['name']) ) { |
|
49 | + if (is_array($plugin) && ! empty($plugin['name'])) { |
|
50 | 50 | $this->plugin_name = $plugin['name']; |
51 | 51 | } else { |
52 | 52 | $this->plugin_name = ''; |
53 | 53 | } |
54 | 54 | |
55 | - if ( is_array($plugin) && !empty($plugin['textdomain']) ) { |
|
55 | + if (is_array($plugin) && ! empty($plugin['textdomain'])) { |
|
56 | 56 | $this->textdomain = $plugin['textdomain']; |
57 | 57 | } else { |
58 | 58 | $this->textdomain = 'wpupdatephp'; |
59 | 59 | } |
60 | 60 | |
61 | - if ( is_array($requirements) && !empty($requirements['recommended_version']) ) { |
|
61 | + if (is_array($requirements) && ! empty($requirements['recommended_version'])) { |
|
62 | 62 | $this->minimum_version = $requirements['minimum_version']; |
63 | 63 | } else { |
64 | 64 | $this->minimum_version = '5.3.0'; |
65 | 65 | } |
66 | 66 | |
67 | - if ( is_array($requirements) && !empty($requirements['recommended_version']) ) { |
|
67 | + if (is_array($requirements) && ! empty($requirements['recommended_version'])) { |
|
68 | 68 | $this->recommended_version = $requirements['recommended_version']; |
69 | 69 | } else { |
70 | 70 | $this->recommended_version = null; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @param callable $callback Callable that displays admin notice. |
127 | 127 | */ |
128 | 128 | private function load_version_notice($callback) { |
129 | - if ( is_admin() && ! defined('DOING_AJAX')) { |
|
129 | + if (is_admin() && ! defined('DOING_AJAX')) { |
|
130 | 130 | add_action('admin_notices', $callback); |
131 | 131 | add_action('network_admin_notices', $callback); |
132 | 132 | } |
@@ -36,18 +36,18 @@ discard block |
||
36 | 36 | * If theme does not have a template file for Auto Load Next Post, |
37 | 37 | * the plugin will load a default template. |
38 | 38 | */ |
39 | - $child_path = get_stylesheet_directory() . '/' . AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
40 | - $template_path = get_template_directory() . '/' . AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
39 | + $child_path = get_stylesheet_directory().'/'.AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
40 | + $template_path = get_template_directory().'/'.AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
41 | 41 | $default_path = AUTO_LOAD_NEXT_POST_FILE_PATH; |
42 | 42 | |
43 | - if ( file_exists( $child_path . 'content-partial.php' ) ) { |
|
44 | - include( $child_path . 'content-partial.php' ); |
|
43 | + if (file_exists($child_path.'content-partial.php')) { |
|
44 | + include($child_path.'content-partial.php'); |
|
45 | 45 | } |
46 | - else if( file_exists( $template_path . 'content-partial.php') ) { |
|
47 | - include( $template_path . 'content-partial.php' ); |
|
46 | + else if (file_exists($template_path.'content-partial.php')) { |
|
47 | + include($template_path.'content-partial.php'); |
|
48 | 48 | } |
49 | - else if( file_exists( $default_path . '/template/content-partial.php' ) ) { |
|
50 | - include( $default_path . '/template/content-partial.php' ); |
|
49 | + else if (file_exists($default_path.'/template/content-partial.php')) { |
|
50 | + include($default_path.'/template/content-partial.php'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | exit; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | function auto_load_next_post_comments() { |
63 | 63 | // If comments are open or we have at least one comment, load up the comment template. |
64 | - if ( comments_open() || get_comments_number() ) : |
|
64 | + if (comments_open() || get_comments_number()) : |
|
65 | 65 | comments_template(); |
66 | 66 | endif; |
67 | 67 | } |
@@ -42,11 +42,9 @@ |
||
42 | 42 | |
43 | 43 | if ( file_exists( $child_path . 'content-partial.php' ) ) { |
44 | 44 | include( $child_path . 'content-partial.php' ); |
45 | - } |
|
46 | - else if( file_exists( $template_path . 'content-partial.php') ) { |
|
45 | + } else if( file_exists( $template_path . 'content-partial.php') ) { |
|
47 | 46 | include( $template_path . 'content-partial.php' ); |
48 | - } |
|
49 | - else if( file_exists( $default_path . '/template/content-partial.php' ) ) { |
|
47 | + } else if( file_exists( $default_path . '/template/content-partial.php' ) ) { |
|
50 | 48 | include( $default_path . '/template/content-partial.php' ); |
51 | 49 | } |
52 | 50 |
@@ -69,7 +69,7 @@ |
||
69 | 69 | function alnp_template_location() { |
70 | 70 | $current_theme = get_option('template'); |
71 | 71 | |
72 | - switch( $current_theme ) { |
|
72 | + switch ($current_theme) { |
|
73 | 73 | case 'twentyseventeen': |
74 | 74 | $path = 'template-parts/post/'; |
75 | 75 | break; |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | $template_location = apply_filters('alnp_template_location', ''); // e.g. "template-parts/post/" |
9 | 9 | |
10 | -if ( have_posts() ) : |
|
10 | +if (have_posts()) : |
|
11 | 11 | |
12 | 12 | // Load content before the loop. |
13 | 13 | do_action('alnp_load_before_loop'); |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | |
26 | 26 | if (false === $post_format) { |
27 | 27 | // Include the standard content.php file. |
28 | - get_template_part($template_location . 'content'); |
|
28 | + get_template_part($template_location.'content'); |
|
29 | 29 | } else { |
30 | 30 | // Include the post format content. |
31 | - if (locate_template($template_location . 'format-'.$post_format.'.php') != '') { |
|
32 | - get_template_part($template_location . 'format', $post_format); |
|
31 | + if (locate_template($template_location.'format-'.$post_format.'.php') != '') { |
|
32 | + get_template_part($template_location.'format', $post_format); |
|
33 | 33 | } else { |
34 | 34 | // If no format-{post-format}.php file found then fallback to content-{post-format}.php |
35 | - get_template_part($template_location . 'content', $post_format); |
|
35 | + get_template_part($template_location.'content', $post_format); |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 |
@@ -48,9 +48,11 @@ |
||
48 | 48 | // Load content after the loop. |
49 | 49 | do_action('alnp_load_after_loop'); |
50 | 50 | |
51 | -else : |
|
51 | +else { |
|
52 | + : |
|
52 | 53 | |
53 | 54 | // Load content if there are no more posts. |
54 | 55 | do_action('alnp_no_more_posts'); |
56 | +} |
|
55 | 57 | |
56 | 58 | endif; // END if have_posts() |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | exit; // Exit if accessed directly. |
32 | 32 | } |
33 | 33 | |
34 | -if ( ! class_exists('Auto_Load_Next_Post') ) { |
|
34 | +if ( ! class_exists('Auto_Load_Next_Post')) { |
|
35 | 35 | |
36 | 36 | /** |
37 | 37 | * Main Auto Load Next Post Class |
@@ -220,9 +220,9 @@ discard block |
||
220 | 220 | * @version 1.4.8 |
221 | 221 | */ |
222 | 222 | public function load_plugin_textdomain() { |
223 | - $locale = apply_filters( 'plugin_locale', get_locale(), 'auto-load-next-post' ); |
|
224 | - load_textdomain( 'auto-load-next-post', WP_LANG_DIR . '/auto-load-next-post/auto-load-next-post-' . $locale . '.mo' ); |
|
225 | - load_plugin_textdomain( 'auto-load-next-post', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' ); |
|
223 | + $locale = apply_filters('plugin_locale', get_locale(), 'auto-load-next-post'); |
|
224 | + load_textdomain('auto-load-next-post', WP_LANG_DIR.'/auto-load-next-post/auto-load-next-post-'.$locale.'.mo'); |
|
225 | + load_plugin_textdomain('auto-load-next-post', false, plugin_basename(dirname(__FILE__)).'/languages'); |
|
226 | 226 | } // END load_plugin_textdomain() |
227 | 227 | |
228 | 228 | /** |
@@ -8,24 +8,24 @@ |
||
8 | 8 | * @package Auto Load Next Post |
9 | 9 | * @license GPL-2.0+ |
10 | 10 | */ |
11 | -if ( ! defined( 'ABSPATH' ) || ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
11 | +if ( ! defined('ABSPATH') || ! defined('WP_UNINSTALL_PLUGIN')) { |
|
12 | 12 | exit(); // Exit if accessed directly. |
13 | 13 | } |
14 | 14 | |
15 | 15 | global $wpdb; |
16 | 16 | |
17 | 17 | // For a single site |
18 | -if ( ! is_multisite() ) { |
|
19 | - $uninstall = get_option( 'auto_load_next_post_uninstall_data' ); |
|
18 | +if ( ! is_multisite()) { |
|
19 | + $uninstall = get_option('auto_load_next_post_uninstall_data'); |
|
20 | 20 | |
21 | - if ( ! empty( $uninstall ) ) { |
|
21 | + if ( ! empty($uninstall)) { |
|
22 | 22 | // Delete options |
23 | 23 | $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'auto_load_next_post_%';"); |
24 | 24 | } |
25 | 25 | } |
26 | 26 | |
27 | 27 | // Delete Site options |
28 | -delete_site_option( 'auto_load_next_post_install_date' ); |
|
28 | +delete_site_option('auto_load_next_post_install_date'); |
|
29 | 29 | |
30 | 30 | // Delete Uninstall Data |
31 | -delete_option( 'auto_load_next_post_uninstall_data' ); |
|
31 | +delete_option('auto_load_next_post_uninstall_data'); |
@@ -15,6 +15,6 @@ |
||
15 | 15 | } |
16 | 16 | ?> |
17 | 17 | <div class="notice notice-warning auto-load-next-post-message"> |
18 | - <p><?php _e( sprintf( 'The theme you are using has not declared support for <b>%s</b> – please see the F.A.Q. to find out how.', 'Auto Load Next Post' ), 'auto-load-next-post' ); ?></p> |
|
19 | - <p><a href="<?php echo esc_url( 'https://autoloadnextpost.com/f-a-q/' ); ?>" class="button-primary"><?php _e( 'Frequently Asked Questions', 'auto-load-next-post' ); ?></a> <a class="skip button-primary" href="<?php echo esc_url( add_query_arg( 'hide_auto_load_next_post_theme_support_check', 'true' ) ); ?>"><?php _e( 'Hide this notice', 'auto-load-next-post' ); ?></a></p> |
|
18 | + <p><?php _e(sprintf('The theme you are using has not declared support for <b>%s</b> – please see the F.A.Q. to find out how.', 'Auto Load Next Post'), 'auto-load-next-post'); ?></p> |
|
19 | + <p><a href="<?php echo esc_url('https://autoloadnextpost.com/f-a-q/'); ?>" class="button-primary"><?php _e('Frequently Asked Questions', 'auto-load-next-post'); ?></a> <a class="skip button-primary" href="<?php echo esc_url(add_query_arg('hide_auto_load_next_post_theme_support_check', 'true')); ?>"><?php _e('Hide this notice', 'auto-load-next-post'); ?></a></p> |
|
20 | 20 | </div> |