@@ -12,7 +12,7 @@ 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 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @see alnp_meta_version() |
23 | 23 | */ |
24 | -add_action( 'wp_head', 'alnp_meta_version' ); |
|
24 | +add_action('wp_head', 'alnp_meta_version'); |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Repeater Template |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @see auto_load_next_post_comments() |
32 | 32 | * @see auto_load_next_post_navigation() |
33 | 33 | */ |
34 | -add_action( 'template_redirect', 'alnp_template_redirect' ); |
|
35 | -add_action( 'alnp_load_content', 'alnp_load_fallback_content', 1, 10 ); |
|
36 | -add_action( 'alnp_load_after_content', 'auto_load_next_post_comments', 1, 5 ); |
|
37 | -add_action( 'alnp_load_after_content', 'auto_load_next_post_navigation', 1, 10 ); |
|
34 | +add_action('template_redirect', 'alnp_template_redirect'); |
|
35 | +add_action('alnp_load_content', 'alnp_load_fallback_content', 1, 10); |
|
36 | +add_action('alnp_load_after_content', 'auto_load_next_post_comments', 1, 5); |
|
37 | +add_action('alnp_load_after_content', 'auto_load_next_post_navigation', 1, 10); |
@@ -13,11 +13,11 @@ discard block |
||
13 | 13 | */ |
14 | 14 | |
15 | 15 | // Exit if accessed directly. |
16 | -if ( ! defined( 'ABSPATH' ) ) { |
|
16 | +if ( ! defined('ABSPATH')) { |
|
17 | 17 | exit; |
18 | 18 | } |
19 | 19 | |
20 | -if ( ! function_exists( 'alnp_get_post_type' ) ) { |
|
20 | +if ( ! function_exists('alnp_get_post_type')) { |
|
21 | 21 | /** |
22 | 22 | * Returns the post type. |
23 | 23 | * |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $post_type = get_post_type(); |
29 | 29 | |
30 | 30 | // If the post type is a post then return single instead. |
31 | - if ( $post_type == 'post' ) { |
|
31 | + if ($post_type == 'post') { |
|
32 | 32 | return 'single'; |
33 | 33 | } |
34 | 34 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
39 | -if ( ! function_exists( 'alnp_get_post_types' ) ) { |
|
39 | +if ( ! function_exists('alnp_get_post_types')) { |
|
40 | 40 | /** |
41 | 41 | * This returns a list of public registered post types. |
42 | 42 | * |
@@ -49,35 +49,35 @@ discard block |
||
49 | 49 | ); |
50 | 50 | |
51 | 51 | // If Auto Load Next Post Pro is installed then return all public post types. |
52 | - if ( is_alnp_pro_version_installed() ) { |
|
53 | - $post_types = get_post_types( array( 'public' => true ), 'names' ); |
|
52 | + if (is_alnp_pro_version_installed()) { |
|
53 | + $post_types = get_post_types(array('public' => true), 'names'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | // Un-supported post types are unset. |
57 | - $post_types = alnp_unset_unsupported_post_types( $post_types ); |
|
57 | + $post_types = alnp_unset_unsupported_post_types($post_types); |
|
58 | 58 | |
59 | 59 | return $post_types; |
60 | 60 | } // END alnp_get_post_types() |
61 | 61 | } |
62 | 62 | |
63 | -if ( ! function_exists( 'alnp_unset_unsupported_post_types' ) ) { |
|
63 | +if ( ! function_exists('alnp_unset_unsupported_post_types')) { |
|
64 | 64 | /** |
65 | 65 | * Unsets un-supported post types. |
66 | 66 | * |
67 | 67 | * @since 1.6.0 |
68 | 68 | * @return array $post_types |
69 | 69 | */ |
70 | - function alnp_unset_unsupported_post_types( $post_types ) { |
|
71 | - unset( $post_types['elementor_library'] ); |
|
72 | - unset( $post_types['tdb_templates'] ); |
|
70 | + function alnp_unset_unsupported_post_types($post_types) { |
|
71 | + unset($post_types['elementor_library']); |
|
72 | + unset($post_types['tdb_templates']); |
|
73 | 73 | |
74 | - $post_types = apply_filters( 'alnp_unset_unsupported_post_types', $post_types ); |
|
74 | + $post_types = apply_filters('alnp_unset_unsupported_post_types', $post_types); |
|
75 | 75 | |
76 | 76 | return $post_types; |
77 | 77 | } // END alnp_unset_unsupported_post_types() |
78 | 78 | } |
79 | 79 | |
80 | -if ( ! function_exists( 'alnp_get_random_page_permalink' ) ) { |
|
80 | +if ( ! function_exists('alnp_get_random_page_permalink')) { |
|
81 | 81 | /** |
82 | 82 | * Returns the permalink of a random page |
83 | 83 | * |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @param string $post_type - Default is post. |
86 | 86 | * @return int|boolean |
87 | 87 | */ |
88 | - function alnp_get_random_page_permalink( $post_type = 'post' ) { |
|
88 | + function alnp_get_random_page_permalink($post_type = 'post') { |
|
89 | 89 | $args = array( |
90 | 90 | 'post_type' => $post_type, |
91 | 91 | 'post_status' => 'publish', |
@@ -93,13 +93,13 @@ discard block |
||
93 | 93 | 'posts_per_page' => 1 |
94 | 94 | ); |
95 | 95 | |
96 | - $query = new WP_Query( $args ); |
|
96 | + $query = new WP_Query($args); |
|
97 | 97 | |
98 | - if ( $query->have_posts() ) { |
|
99 | - while ( $query->have_posts() ) : $query->the_post(); |
|
98 | + if ($query->have_posts()) { |
|
99 | + while ($query->have_posts()) : $query->the_post(); |
|
100 | 100 | $id = get_the_ID(); |
101 | 101 | |
102 | - return get_permalink( $id ); |
|
102 | + return get_permalink($id); |
|
103 | 103 | endwhile; |
104 | 104 | } else { |
105 | 105 | return false; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } // END alnp_get_random_page_permalink() |
108 | 108 | } |
109 | 109 | |
110 | -if ( ! function_exists( 'alnp_load_js_in_footer' ) ) { |
|
110 | +if ( ! function_exists('alnp_load_js_in_footer')) { |
|
111 | 111 | /** |
112 | 112 | * This helps the plugin decide to load the JavaScript in the footer or not. |
113 | 113 | * |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | * @return boolean |
116 | 116 | */ |
117 | 117 | function alnp_load_js_in_footer() { |
118 | - $load_in_footer = get_option( 'auto_load_next_post_load_js_in_footer', false ); |
|
118 | + $load_in_footer = get_option('auto_load_next_post_load_js_in_footer', false); |
|
119 | 119 | |
120 | - if ( isset( $load_in_footer ) && $load_in_footer == 'yes' ) { |
|
120 | + if (isset($load_in_footer) && $load_in_footer == 'yes') { |
|
121 | 121 | return true; |
122 | 122 | } |
123 | 123 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | } // END alnp_load_js_in_footer() |
126 | 126 | } |
127 | 127 | |
128 | -if ( ! function_exists( 'alnp_disable_on_mobile' ) ) { |
|
128 | +if ( ! function_exists('alnp_disable_on_mobile')) { |
|
129 | 129 | /** |
130 | 130 | * This helps the plugin decide to disable Auto Load Next Post |
131 | 131 | * from running on mobile devices. |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | * @return boolean |
135 | 135 | */ |
136 | 136 | function alnp_disable_on_mobile() { |
137 | - $disable_mobile = get_option( 'auto_load_next_post_disable_on_mobile', false ); |
|
137 | + $disable_mobile = get_option('auto_load_next_post_disable_on_mobile', false); |
|
138 | 138 | |
139 | - if ( isset( $disable_mobile ) && $disable_mobile == 'yes' ) { |
|
139 | + if (isset($disable_mobile) && $disable_mobile == 'yes') { |
|
140 | 140 | return true; |
141 | 141 | } |
142 | 142 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | } // END alnp_disable_on_mobile() |
145 | 145 | } |
146 | 146 | |
147 | -if ( ! function_exists( 'alnp_get_admin_screens' ) ) { |
|
147 | +if ( ! function_exists('alnp_get_admin_screens')) { |
|
148 | 148 | /** |
149 | 149 | * These are the only screens Auto Load Next Post will focus |
150 | 150 | * on displaying notices or equeue scripts/styles. |
@@ -163,13 +163,13 @@ discard block |
||
163 | 163 | } // END alnp_get_admin_screens() |
164 | 164 | } |
165 | 165 | |
166 | -if ( ! function_exists( 'alnp_meta_version' ) ) { |
|
166 | +if ( ! function_exists('alnp_meta_version')) { |
|
167 | 167 | /** |
168 | 168 | * Adds the plugin version to the header. |
169 | 169 | * |
170 | 170 | * @since 1.6.0 |
171 | 171 | */ |
172 | 172 | function alnp_meta_version() { |
173 | - echo '<meta name="generator" content="Auto Load Next Post ' . esc_attr( AUTO_LOAD_NEXT_POST_VERSION ) . '" />' . "\n"; |
|
173 | + echo '<meta name="generator" content="Auto Load Next Post '.esc_attr(AUTO_LOAD_NEXT_POST_VERSION).'" />'."\n"; |
|
174 | 174 | } // END alnp_meta_version() |
175 | 175 | } |
176 | 176 | \ No newline at end of file |