@@ -8,32 +8,32 @@ |
||
8 | 8 | * @version 1.5.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() |
@@ -31,9 +31,11 @@ |
||
31 | 31 | // Load content after the loop. |
32 | 32 | do_action( 'alnp_load_after_loop' ); |
33 | 33 | |
34 | -else : |
|
34 | +else { |
|
35 | + : |
|
35 | 36 | |
36 | 37 | // Load content if there are no more posts. |
37 | 38 | do_action( 'alnp_no_more_posts' ); |
39 | +} |
|
38 | 40 | |
39 | 41 | endif; // END if have_posts() |
@@ -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 ( ! class_exists( 'Auto_Load_Next_Post_Autoloader' ) ) { |
|
19 | +if ( ! class_exists('Auto_Load_Next_Post_Autoloader')) { |
|
20 | 20 | |
21 | 21 | class Auto_Load_Next_Post_Autoloader { |
22 | 22 | |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | * The Constructor. |
33 | 33 | */ |
34 | 34 | public function __construct() { |
35 | - if ( function_exists( '__autoload' ) ) { |
|
36 | - spl_autoload_register( '__autoload' ); |
|
35 | + if (function_exists('__autoload')) { |
|
36 | + spl_autoload_register('__autoload'); |
|
37 | 37 | } |
38 | 38 | |
39 | - spl_autoload_register( array( $this, 'autoload' ) ); |
|
39 | + spl_autoload_register(array($this, 'autoload')); |
|
40 | 40 | |
41 | - $this->include_path = untrailingslashit( plugin_dir_path( AUTO_LOAD_NEXT_POST_FILE ) ) . '/includes/'; |
|
41 | + $this->include_path = untrailingslashit(plugin_dir_path(AUTO_LOAD_NEXT_POST_FILE)).'/includes/'; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | * @param string $class Class name. |
49 | 49 | * @return string |
50 | 50 | */ |
51 | - private function get_file_name_from_class( $class ) { |
|
52 | - return 'class-' . str_replace( '_', '-', $class ) . '.php'; |
|
51 | + private function get_file_name_from_class($class) { |
|
52 | + return 'class-'.str_replace('_', '-', $class).'.php'; |
|
53 | 53 | } // END get_file_name_from_class() |
54 | 54 | |
55 | 55 | /** |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | * @param string $path File path. |
60 | 60 | * @return bool Successful or not. |
61 | 61 | */ |
62 | - private function load_file( $path ) { |
|
63 | - if ( $path && is_readable( $path ) ) { |
|
62 | + private function load_file($path) { |
|
63 | + if ($path && is_readable($path)) { |
|
64 | 64 | include_once $path; |
65 | 65 | return true; |
66 | 66 | } |
@@ -73,22 +73,22 @@ discard block |
||
73 | 73 | * @access public |
74 | 74 | * @param string $class Class name. |
75 | 75 | */ |
76 | - public function autoload( $class ) { |
|
77 | - $class = strtolower( $class ); |
|
76 | + public function autoload($class) { |
|
77 | + $class = strtolower($class); |
|
78 | 78 | |
79 | - if ( 0 !== strpos( $class, 'alnp_' ) ) { |
|
79 | + if (0 !== strpos($class, 'alnp_')) { |
|
80 | 80 | return; |
81 | 81 | } |
82 | 82 | |
83 | - $file = $this->get_file_name_from_class( $class ); |
|
83 | + $file = $this->get_file_name_from_class($class); |
|
84 | 84 | $path = ''; |
85 | 85 | |
86 | - if ( 0 === strpos( $class, 'alnp_admin' ) ) { |
|
87 | - $path = $this->include_path . 'admin/'; |
|
86 | + if (0 === strpos($class, 'alnp_admin')) { |
|
87 | + $path = $this->include_path.'admin/'; |
|
88 | 88 | } |
89 | 89 | |
90 | - if ( empty( $path ) || ! $this->load_file( $path . $file ) ) { |
|
91 | - $this->load_file( $this->include_path . $file ); |
|
90 | + if (empty($path) || ! $this->load_file($path.$file)) { |
|
91 | + $this->load_file($this->include_path.$file); |
|
92 | 92 | } |
93 | 93 | } // END autoload() |
94 | 94 |
@@ -31,9 +31,11 @@ |
||
31 | 31 | // Load content after the loop. |
32 | 32 | do_action( 'alnp_load_after_loop' ); |
33 | 33 | |
34 | -else : |
|
34 | +else { |
|
35 | + : |
|
35 | 36 | |
36 | 37 | // Load content if there are no more posts. |
37 | 38 | do_action( 'alnp_no_more_posts' ); |
39 | +} |
|
38 | 40 | |
39 | 41 | endif; // END if have_posts() |
@@ -16,72 +16,72 @@ |
||
16 | 16 | * @version 1.5.12 |
17 | 17 | */ |
18 | 18 | |
19 | -if ( have_posts() ) : |
|
19 | +if (have_posts()) : |
|
20 | 20 | |
21 | 21 | // Load content before the loop. |
22 | - do_action( 'alnp_load_before_loop' ); |
|
22 | + do_action('alnp_load_before_loop'); |
|
23 | 23 | |
24 | 24 | // Check that there are posts to load. |
25 | - while ( have_posts() ) : the_post(); |
|
25 | + while (have_posts()) : the_post(); |
|
26 | 26 | |
27 | 27 | $post_format = get_post_format(); // Post Format e.g. video |
28 | 28 | |
29 | 29 | $post_type = alnp_get_post_type(); // Post Type e.g. single |
30 | 30 | |
31 | 31 | // Load content before the post content. |
32 | - do_action( 'alnp_load_before_content' ); |
|
32 | + do_action('alnp_load_before_content'); |
|
33 | 33 | |
34 | 34 | // Load content before the post content for a specific post format. |
35 | - do_action( 'alnp_load_before_content_post_format_' . $post_format ); |
|
35 | + do_action('alnp_load_before_content_post_format_'.$post_format); |
|
36 | 36 | |
37 | 37 | // Load content before the post content for a specific post type. |
38 | - do_action( 'alnp_load_before_content_post_type_' . $post_type ); |
|
38 | + do_action('alnp_load_before_content_post_type_'.$post_type); |
|
39 | 39 | |
40 | - if ( false === $post_format ) { |
|
40 | + if (false === $post_format) { |
|
41 | 41 | /* |
42 | 42 | * Include the Post-Type-specific template for the content. |
43 | 43 | * content-___.php (where ___ is the Post Type name). |
44 | 44 | */ |
45 | - if ( locate_template( alnp_template_location() . 'content-' . $post_type . '.php') != '' ) { |
|
46 | - get_template_part( alnp_template_location() . 'content', $post_type ); |
|
47 | - } else if ( locate_template( alnp_template_location() . 'content-post.php') != '' ) { |
|
45 | + if (locate_template(alnp_template_location().'content-'.$post_type.'.php') != '') { |
|
46 | + get_template_part(alnp_template_location().'content', $post_type); |
|
47 | + } else if (locate_template(alnp_template_location().'content-post.php') != '') { |
|
48 | 48 | // If not looking for other post types and content-post.php is found. |
49 | - get_template_part( alnp_template_location() . 'content', 'post' ); |
|
49 | + get_template_part(alnp_template_location().'content', 'post'); |
|
50 | 50 | } else { |
51 | 51 | // If no specific post type found then fallback to standard content.php file. |
52 | - get_template_part( alnp_template_location() . 'content' ); |
|
52 | + get_template_part(alnp_template_location().'content'); |
|
53 | 53 | } |
54 | 54 | } else { |
55 | 55 | /* |
56 | 56 | * Include the Post-Format-specific template for the content. |
57 | 57 | * called format-___.php (where ___ is the Post Format name). |
58 | 58 | */ |
59 | - if ( locate_template( alnp_template_location() . 'format-' . $post_format . '.php' ) != '' ) { |
|
60 | - get_template_part( alnp_template_location() . 'format', $post_format ); |
|
59 | + if (locate_template(alnp_template_location().'format-'.$post_format.'.php') != '') { |
|
60 | + get_template_part(alnp_template_location().'format', $post_format); |
|
61 | 61 | } else { |
62 | 62 | // If no format-{post-format}.php file found then fallback to content-{post-format}.php |
63 | - get_template_part( alnp_template_location() . 'content', $post_format ); |
|
63 | + get_template_part(alnp_template_location().'content', $post_format); |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
67 | 67 | // Load content after the post content for a specific post type. |
68 | - do_action( 'alnp_load_after_content_post_type_' . $post_type ); |
|
68 | + do_action('alnp_load_after_content_post_type_'.$post_type); |
|
69 | 69 | |
70 | 70 | // Load content after the post content for a specific post format. |
71 | - do_action( 'alnp_load_after_content_post_format_' . $post_format ); |
|
71 | + do_action('alnp_load_after_content_post_format_'.$post_format); |
|
72 | 72 | |
73 | 73 | // Load content after the post content. |
74 | - do_action( 'alnp_load_after_content' ); |
|
74 | + do_action('alnp_load_after_content'); |
|
75 | 75 | |
76 | 76 | // End the loop. |
77 | 77 | endwhile; |
78 | 78 | |
79 | 79 | // Load content after the loop. |
80 | - do_action( 'alnp_load_after_loop' ); |
|
80 | + do_action('alnp_load_after_loop'); |
|
81 | 81 | |
82 | 82 | else : |
83 | 83 | |
84 | 84 | // Load content if there are no more posts. |
85 | - do_action( 'alnp_no_more_posts' ); |
|
85 | + do_action('alnp_no_more_posts'); |
|
86 | 86 | |
87 | 87 | endif; // END if have_posts() |
@@ -12,16 +12,16 @@ |
||
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 | 19 | // Exit if WP_Customize_Control does not exsist. |
20 | -if ( ! class_exists( 'WP_Customize_Control' ) ) { |
|
20 | +if ( ! class_exists('WP_Customize_Control')) { |
|
21 | 21 | return null; |
22 | 22 | } |
23 | 23 | |
24 | -if ( !class_exists( 'Auto_Load_Next_Post_Display_Video_Controller' ) ) { |
|
24 | +if ( ! class_exists('Auto_Load_Next_Post_Display_Video_Controller')) { |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * This class is for the display video control in the Customizer. |
@@ -10,10 +10,10 @@ |
||
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="notice notice-info"> |
18 | - <p><?php echo sprintf( __( 'This theme supports %s. No need to change the theme selectors as they have already been set by the theme.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ); ?></p> |
|
18 | + <p><?php echo sprintf(__('This theme supports %s. No need to change the theme selectors as they have already been set by the theme.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')); ?></p> |
|
19 | 19 | </div> |
@@ -10,10 +10,10 @@ |
||
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="notice jetpack-info"> |
18 | - <p><?php echo sprintf( __( 'You have enabled the Lazy-loading for Images module in JetPack. To trigger the lazy loading event apply %s to "Entering a Post".', 'auto-load-next-post' ), '<code>jetpack-lazy-images-load</code>' ); ?></p> |
|
18 | + <p><?php echo sprintf(__('You have enabled the Lazy-loading for Images module in JetPack. To trigger the lazy loading event apply %s to "Entering a Post".', 'auto-load-next-post'), '<code>jetpack-lazy-images-load</code>'); ?></p> |
|
19 | 19 | </div> |
@@ -11,10 +11,10 @@ |
||
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 | 18 | <div class="notice notice-error"> |
19 | - <p><?php echo sprintf( __( 'Sorry, <strong>%s</strong> requires WordPress %s or higher. Please upgrade your WordPress setup.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE ); ?></p> |
|
19 | + <p><?php echo sprintf(__('Sorry, <strong>%s</strong> requires WordPress %s or higher. Please upgrade your WordPress setup.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post'), AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE); ?></p> |
|
20 | 20 | </div> |
@@ -14,11 +14,11 @@ discard block |
||
14 | 14 | */ |
15 | 15 | |
16 | 16 | // Exit if accessed directly. |
17 | -if ( ! defined( 'ABSPATH' ) ) { |
|
17 | +if ( ! defined('ABSPATH')) { |
|
18 | 18 | exit; |
19 | 19 | } |
20 | 20 | |
21 | -if ( ! function_exists( 'auto_load_next_post_is_ajax' ) ) { |
|
21 | +if ( ! function_exists('auto_load_next_post_is_ajax')) { |
|
22 | 22 | /** |
23 | 23 | * Returns true when the page is loaded via ajax. |
24 | 24 | * |
@@ -27,15 +27,15 @@ discard block |
||
27 | 27 | * @return bool |
28 | 28 | */ |
29 | 29 | function auto_load_next_post_is_ajax() { |
30 | - if ( defined( 'DOING_AJAX' ) ) { |
|
30 | + if (defined('DOING_AJAX')) { |
|
31 | 31 | return true; |
32 | 32 | } |
33 | 33 | |
34 | - return( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) ? true : false; |
|
34 | + return(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') ? true : false; |
|
35 | 35 | } // END auto_load_next_post_is_ajax |
36 | 36 | } |
37 | 37 | |
38 | -if ( ! function_exists( 'alnp_template_location' ) ) { |
|
38 | +if ( ! function_exists('alnp_template_location')) { |
|
39 | 39 | /** |
40 | 40 | * Filters the template location for get_template_part(). |
41 | 41 | * |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | function alnp_template_location() { |
48 | 48 | $current_theme = get_option('template'); |
49 | 49 | |
50 | - switch( $current_theme ) { |
|
50 | + switch ($current_theme) { |
|
51 | 51 | case 'twentyseventeen': |
52 | 52 | $path = 'template-parts/post/'; |
53 | 53 | break; |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | break; |
62 | 62 | } |
63 | 63 | |
64 | - return apply_filters( 'alnp_template_location', $path ); |
|
64 | + return apply_filters('alnp_template_location', $path); |
|
65 | 65 | } // END alnp_template_location() |
66 | 66 | } |
67 | 67 | |
68 | -if ( ! function_exists( 'is_alnp_pro_version_installed' ) ) { |
|
68 | +if ( ! function_exists('is_alnp_pro_version_installed')) { |
|
69 | 69 | /** |
70 | 70 | * Detects if Auto Load Next Post Pro is installed. |
71 | 71 | * |
@@ -74,17 +74,17 @@ discard block |
||
74 | 74 | * @return boolean |
75 | 75 | */ |
76 | 76 | function is_alnp_pro_version_installed() { |
77 | - $active_plugins = (array) get_option( 'active_plugins', array() ); |
|
77 | + $active_plugins = (array) get_option('active_plugins', array()); |
|
78 | 78 | |
79 | - if ( is_multisite() ) { |
|
80 | - $active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) ); |
|
79 | + if (is_multisite()) { |
|
80 | + $active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array())); |
|
81 | 81 | } |
82 | 82 | |
83 | - return in_array( 'auto-load-next-post-pro/auto-load-next-post-pro.php', $active_plugins ) || array_key_exists( 'auto-load-next-post-pro/auto-load-next-post-pro.php', $active_plugins ); |
|
83 | + return in_array('auto-load-next-post-pro/auto-load-next-post-pro.php', $active_plugins) || array_key_exists('auto-load-next-post-pro/auto-load-next-post-pro.php', $active_plugins); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | -if ( ! function_exists( 'is_alnp_beta' ) ) { |
|
87 | +if ( ! function_exists('is_alnp_beta')) { |
|
88 | 88 | /** |
89 | 89 | * Returns true if Auto Load Next Post is a beta release. |
90 | 90 | * |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @return boolean |
93 | 93 | */ |
94 | 94 | function is_alnp_beta() { |
95 | - if ( strpos( AUTO_LOAD_NEXT_POST_VERSION, 'beta' ) ) { |
|
95 | + if (strpos(AUTO_LOAD_NEXT_POST_VERSION, 'beta')) { |
|
96 | 96 | return true; |
97 | 97 | } |
98 | 98 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | -if ( ! function_exists( 'is_alnp_active_theme' ) ) { |
|
103 | +if ( ! function_exists('is_alnp_active_theme')) { |
|
104 | 104 | /** |
105 | 105 | * See if theme/s is activate or not. |
106 | 106 | * |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | * @param string|array $theme Theme name or array of theme names to check. |
109 | 109 | * @return boolean |
110 | 110 | */ |
111 | - function is_alnp_active_theme( $theme ) { |
|
112 | - return is_array( $theme ) ? in_array( get_template(), $theme, true ) : get_template() === $theme; |
|
111 | + function is_alnp_active_theme($theme) { |
|
112 | + return is_array($theme) ? in_array(get_template(), $theme, true) : get_template() === $theme; |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
116 | -if ( ! function_exists( 'is_alnp_supported' ) ) { |
|
116 | +if ( ! function_exists('is_alnp_supported')) { |
|
117 | 117 | /** |
118 | 118 | * Returns true if Auto Load Next Post is supported in the theme. |
119 | 119 | * |
@@ -121,9 +121,9 @@ discard block |
||
121 | 121 | * @return boolean |
122 | 122 | */ |
123 | 123 | function is_alnp_supported() { |
124 | - $theme_support = current_theme_supports( 'auto-load-next-post' ); |
|
124 | + $theme_support = current_theme_supports('auto-load-next-post'); |
|
125 | 125 | |
126 | - if ( ! $theme_support ) { |
|
126 | + if ( ! $theme_support) { |
|
127 | 127 | return false; |
128 | 128 | } |
129 | 129 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | } |
133 | 133 | |
134 | -if ( ! function_exists( 'alnp_get_theme_support' ) ) { |
|
134 | +if ( ! function_exists('alnp_get_theme_support')) { |
|
135 | 135 | /** |
136 | 136 | * Return "theme support" values from the current theme, if set. |
137 | 137 | * |
@@ -140,25 +140,25 @@ discard block |
||
140 | 140 | * @param mixed $default Optional value to return if the theme does not declare support for a prop. |
141 | 141 | * @return mixed Value of prop(s). |
142 | 142 | */ |
143 | - function alnp_get_theme_support( $prop = '', $default = null ) { |
|
144 | - $theme_support = get_theme_support( 'auto-load-next-post' ); |
|
145 | - $theme_support = is_array( $theme_support ) ? $theme_support[0] : false; |
|
143 | + function alnp_get_theme_support($prop = '', $default = null) { |
|
144 | + $theme_support = get_theme_support('auto-load-next-post'); |
|
145 | + $theme_support = is_array($theme_support) ? $theme_support[0] : false; |
|
146 | 146 | |
147 | - if ( ! $theme_support ) { |
|
147 | + if ( ! $theme_support) { |
|
148 | 148 | return $default; |
149 | 149 | } |
150 | 150 | |
151 | - if ( ! empty( $prop ) ) { |
|
152 | - $prop_stack = explode( '::', $prop ); |
|
153 | - $prop_key = array_shift( $prop_stack ); |
|
151 | + if ( ! empty($prop)) { |
|
152 | + $prop_stack = explode('::', $prop); |
|
153 | + $prop_key = array_shift($prop_stack); |
|
154 | 154 | |
155 | - if ( isset( $theme_support[ $prop_key ] ) ) { |
|
156 | - $value = $theme_support[ $prop_key ]; |
|
155 | + if (isset($theme_support[$prop_key])) { |
|
156 | + $value = $theme_support[$prop_key]; |
|
157 | 157 | |
158 | - if ( count( $prop_stack ) ) { |
|
159 | - foreach ( $prop_stack as $prop_key ) { |
|
160 | - if ( is_array( $value ) && isset( $value[ $prop_key ] ) ) { |
|
161 | - $value = $value[ $prop_key ]; |
|
158 | + if (count($prop_stack)) { |
|
159 | + foreach ($prop_stack as $prop_key) { |
|
160 | + if (is_array($value) && isset($value[$prop_key])) { |
|
161 | + $value = $value[$prop_key]; |
|
162 | 162 | } else { |
163 | 163 | $value = $default; |
164 | 164 | break; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | } |
177 | 177 | } |
178 | 178 | |
179 | -if ( ! function_exists( 'alnp_is_bot' ) ) { |
|
179 | +if ( ! function_exists('alnp_is_bot')) { |
|
180 | 180 | /** |
181 | 181 | * Was the current request made by a known bot? |
182 | 182 | * |
@@ -184,13 +184,13 @@ discard block |
||
184 | 184 | * @return boolean |
185 | 185 | */ |
186 | 186 | function alnp_is_bot() { |
187 | - $is_bot = alnp_is_bot_user_agent( $_SERVER['HTTP_USER_AGENT'] ); |
|
187 | + $is_bot = alnp_is_bot_user_agent($_SERVER['HTTP_USER_AGENT']); |
|
188 | 188 | |
189 | 189 | return $is_bot; |
190 | 190 | } |
191 | 191 | } |
192 | 192 | |
193 | -if ( ! function_exists( 'alnp_is_bot_user_agent' ) ) { |
|
193 | +if ( ! function_exists('alnp_is_bot_user_agent')) { |
|
194 | 194 | /** |
195 | 195 | * Is the given user-agent a known bot? |
196 | 196 | * |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | * @param string A user-agent string |
199 | 199 | * @return boolean |
200 | 200 | */ |
201 | - function alnp_is_bot_user_agent( $ua = null ) { |
|
202 | - if ( empty( $ua ) ) { |
|
201 | + function alnp_is_bot_user_agent($ua = null) { |
|
202 | + if (empty($ua)) { |
|
203 | 203 | return false; |
204 | 204 | } |
205 | 205 | |
@@ -213,8 +213,8 @@ discard block |
||
213 | 213 | 'livelapbot', 'germcrawler', 'domaintunocrawler', 'grapeshotcrawler', 'cloudflare-alwaysonline', |
214 | 214 | ); |
215 | 215 | |
216 | - foreach ( $bot_agents as $bot_agent ) { |
|
217 | - if ( false !== stripos( $ua, $bot_agent ) ) { |
|
216 | + foreach ($bot_agents as $bot_agent) { |
|
217 | + if (false !== stripos($ua, $bot_agent)) { |
|
218 | 218 | return true; |
219 | 219 | } |
220 | 220 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | } |
224 | 224 | } |
225 | 225 | |
226 | -if ( ! function_exists( 'alnp_get_post_type' ) ) { |
|
226 | +if ( ! function_exists('alnp_get_post_type')) { |
|
227 | 227 | /** |
228 | 228 | * Returns the post type. |
229 | 229 | * |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $post_type = get_post_type(); |
236 | 236 | |
237 | 237 | // If the post type is a post then return single instead. |
238 | - if ( $post_type == 'post' ) { |
|
238 | + if ($post_type == 'post') { |
|
239 | 239 | return 'single'; |
240 | 240 | } |
241 | 241 | |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | } |
244 | 244 | } |
245 | 245 | |
246 | -if ( ! function_exists( 'alnp_check_jetpack' ) ) { |
|
246 | +if ( ! function_exists('alnp_check_jetpack')) { |
|
247 | 247 | /** |
248 | 248 | * Check if Jetpack is installed. |
249 | 249 | * |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | * @return string |
253 | 253 | */ |
254 | 254 | function alnp_check_jetpack() { |
255 | - $jetpack_active = class_exists( 'Jetpack' ); |
|
255 | + $jetpack_active = class_exists('Jetpack'); |
|
256 | 256 | |
257 | 257 | $is_active = $jetpack_active ? 'yes' : 'no'; |
258 | 258 |
@@ -10,16 +10,16 @@ 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 | 17 | // Exit if WP_Customize_Control does not exsist. |
18 | -if ( ! class_exists( 'WP_Customize_Control' ) ) { |
|
18 | +if ( ! class_exists('WP_Customize_Control')) { |
|
19 | 19 | return null; |
20 | 20 | } |
21 | 21 | |
22 | -if ( !class_exists( 'Auto_Load_Next_Post_Arbitrary_Control' ) ) { |
|
22 | +if ( ! class_exists('Auto_Load_Next_Post_Arbitrary_Control')) { |
|
23 | 23 | |
24 | 24 | /** |
25 | 25 | * The 'alnp_arbitrary' for Auto Load Next Post Arbitrary control class. |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | * @return void |
33 | 33 | */ |
34 | 34 | public function render_content() { |
35 | - switch ( $this->type ) { |
|
35 | + switch ($this->type) { |
|
36 | 36 | default: |
37 | 37 | case 'text': |
38 | - echo '<p class="description">' . wp_kses_post( $this->description ) . '</p>'; |
|
38 | + echo '<p class="description">'.wp_kses_post($this->description).'</p>'; |
|
39 | 39 | break; |
40 | 40 | |
41 | 41 | case 'heading': |
42 | - echo '<span class="customize-control-title">' . $this->label . '</span>'; |
|
42 | + echo '<span class="customize-control-title">'.$this->label.'</span>'; |
|
43 | 43 | break; |
44 | 44 | |
45 | 45 | case 'divider': |