@@ -13,7 +13,7 @@ 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 | |
@@ -26,12 +26,12 @@ discard block |
||
| 26 | 26 | * @version 1.5.4 |
| 27 | 27 | * @global WP_Query $wp_query - The object information defining the current request and determines what type of query it's dealing with. See https://codex.wordpress.org/Class_Reference/WP_Query |
| 28 | 28 | */ |
| 29 | -if ( ! function_exists( 'auto_load_next_post_template_redirect' ) ) { |
|
| 29 | +if ( ! function_exists('auto_load_next_post_template_redirect')) { |
|
| 30 | 30 | function auto_load_next_post_template_redirect() { |
| 31 | 31 | global $wp_query; |
| 32 | 32 | |
| 33 | 33 | // If this is not a request for alnp or a singular object then bail |
| 34 | - if ( ! isset( $wp_query->query_vars['alnp'] ) || ! is_singular() ) { |
|
| 34 | + if ( ! isset($wp_query->query_vars['alnp']) || ! is_singular()) { |
|
| 35 | 35 | return; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -40,29 +40,29 @@ discard block |
||
| 40 | 40 | * If theme does not have a template file for Auto Load Next Post, |
| 41 | 41 | * the plugin will load a default template. |
| 42 | 42 | */ |
| 43 | - $child_path = get_stylesheet_directory() . '/' . AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
| 44 | - $template_path = get_template_directory() . '/' . AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
| 43 | + $child_path = get_stylesheet_directory().'/'.AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
| 44 | + $template_path = get_template_directory().'/'.AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
| 45 | 45 | $default_path = AUTO_LOAD_NEXT_POST_FILE_PATH; |
| 46 | 46 | $template_redirect = ''; |
| 47 | 47 | |
| 48 | - if ( file_exists( $child_path . 'content-alnp.php' ) ) { |
|
| 49 | - $template_redirect = $child_path . 'content-alnp.php'; |
|
| 48 | + if (file_exists($child_path.'content-alnp.php')) { |
|
| 49 | + $template_redirect = $child_path.'content-alnp.php'; |
|
| 50 | 50 | } |
| 51 | - else if( file_exists( $template_path . 'content-alnp.php') ) { |
|
| 52 | - $template_redirect = $template_path . 'content-alnp.php'; |
|
| 51 | + else if (file_exists($template_path.'content-alnp.php')) { |
|
| 52 | + $template_redirect = $template_path.'content-alnp.php'; |
|
| 53 | 53 | } |
| 54 | - else if( file_exists( $default_path . '/template/content-alnp.php' ) ) { |
|
| 55 | - $template_redirect = $default_path . '/template/content-alnp.php'; |
|
| 54 | + else if (file_exists($default_path.'/template/content-alnp.php')) { |
|
| 55 | + $template_redirect = $default_path.'/template/content-alnp.php'; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - $template_redirect = apply_filters( 'alnp_template_redirect', $template_redirect ); |
|
| 58 | + $template_redirect = apply_filters('alnp_template_redirect', $template_redirect); |
|
| 59 | 59 | |
| 60 | - include( $template_redirect ); |
|
| 60 | + include($template_redirect); |
|
| 61 | 61 | |
| 62 | 62 | exit; |
| 63 | 63 | } // END auto_load_next_post_template_redirect() |
| 64 | 64 | } |
| 65 | -add_action( 'template_redirect', 'auto_load_next_post_template_redirect' ); |
|
| 65 | +add_action('template_redirect', 'auto_load_next_post_template_redirect'); |
|
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * Adds the comments template after the post content. |
@@ -71,15 +71,15 @@ discard block |
||
| 71 | 71 | * @since 1.4.8 |
| 72 | 72 | * @version 1.5.4 |
| 73 | 73 | */ |
| 74 | -if ( ! function_exists( 'auto_load_next_post_comments' ) ) { |
|
| 74 | +if ( ! function_exists('auto_load_next_post_comments')) { |
|
| 75 | 75 | function auto_load_next_post_comments() { |
| 76 | 76 | // If comments are open or we have at least one comment, load up the comment template. |
| 77 | - if ( comments_open() || get_comments_number() ) : |
|
| 77 | + if (comments_open() || get_comments_number()) : |
|
| 78 | 78 | comments_template(); |
| 79 | 79 | endif; |
| 80 | 80 | } // END auto_load_next_post_comments() |
| 81 | 81 | } |
| 82 | -add_action( 'alnp_load_after_content', 'auto_load_next_post_comments', 1, 5 ); |
|
| 82 | +add_action('alnp_load_after_content', 'auto_load_next_post_comments', 1, 5); |
|
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * Adds the post navigation for the previous link only after the post content. |
@@ -88,16 +88,16 @@ discard block |
||
| 88 | 88 | * @since 1.4.8 |
| 89 | 89 | * @version 1.5.4 |
| 90 | 90 | */ |
| 91 | -if ( ! function_exists( 'auto_load_next_post_navigation' ) ) { |
|
| 91 | +if ( ! function_exists('auto_load_next_post_navigation')) { |
|
| 92 | 92 | function auto_load_next_post_navigation() { |
| 93 | 93 | ?> |
| 94 | 94 | <nav class="navigation post-navigation" role="navigation"> |
| 95 | - <span class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'auto-load-next-post' ) . '</span> %title' ); ?></span> |
|
| 95 | + <span class="nav-previous"><?php previous_post_link('%link', '<span class="meta-nav">'._x('←', 'Previous post link', 'auto-load-next-post').'</span> %title'); ?></span> |
|
| 96 | 96 | </nav> |
| 97 | 97 | <?php |
| 98 | 98 | } // END auto_load_next_post_navigation() |
| 99 | 99 | } |
| 100 | -add_action( 'alnp_load_after_content', 'auto_load_next_post_navigation', 1, 10 ); |
|
| 100 | +add_action('alnp_load_after_content', 'auto_load_next_post_navigation', 1, 10); |
|
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | 103 | * Returns the permalink of a random page |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | * @param string $post_type - Default is post. |
| 107 | 107 | * @return int|boolean |
| 108 | 108 | */ |
| 109 | -if ( ! function_exists( 'alnp_get_random_page_permalink' ) ) { |
|
| 110 | - function alnp_get_random_page_permalink( $post_type = 'post' ) { |
|
| 109 | +if ( ! function_exists('alnp_get_random_page_permalink')) { |
|
| 110 | + function alnp_get_random_page_permalink($post_type = 'post') { |
|
| 111 | 111 | $args = array( |
| 112 | 112 | 'post_type' => $post_type, |
| 113 | 113 | 'post_status' => 'publish', |
@@ -115,13 +115,13 @@ discard block |
||
| 115 | 115 | 'posts_per_page' => 1 |
| 116 | 116 | ); |
| 117 | 117 | |
| 118 | - $query = new WP_Query( $args ); |
|
| 118 | + $query = new WP_Query($args); |
|
| 119 | 119 | |
| 120 | - if ( $query->have_posts() ) { |
|
| 121 | - while ( $query->have_posts() ) : $query->the_post(); |
|
| 120 | + if ($query->have_posts()) { |
|
| 121 | + while ($query->have_posts()) : $query->the_post(); |
|
| 122 | 122 | $id = get_the_ID(); |
| 123 | 123 | |
| 124 | - return get_permalink( $id ); |
|
| 124 | + return get_permalink($id); |
|
| 125 | 125 | endwhile; |
| 126 | 126 | } |
| 127 | 127 | else { |
@@ -136,11 +136,11 @@ discard block |
||
| 136 | 136 | * @since 1.5.7 |
| 137 | 137 | * @return boolean |
| 138 | 138 | */ |
| 139 | -if ( ! function_exists( 'alnp_load_js_in_footer' ) ) { |
|
| 139 | +if ( ! function_exists('alnp_load_js_in_footer')) { |
|
| 140 | 140 | function alnp_load_js_in_footer() { |
| 141 | - $load_in_footer = get_option( 'auto_load_next_post_load_js_in_footer', false ); |
|
| 141 | + $load_in_footer = get_option('auto_load_next_post_load_js_in_footer', false); |
|
| 142 | 142 | |
| 143 | - if ( isset( $load_in_footer ) && $load_in_footer == 'yes' ) { |
|
| 143 | + if (isset($load_in_footer) && $load_in_footer == 'yes') { |
|
| 144 | 144 | return true; |
| 145 | 145 | } |
| 146 | 146 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * @since 1.5.11 |
| 156 | 156 | * @return array |
| 157 | 157 | */ |
| 158 | -if ( ! function_exists( 'alnp_get_admin_screens' ) ) { |
|
| 158 | +if ( ! function_exists('alnp_get_admin_screens')) { |
|
| 159 | 159 | function alnp_get_admin_screens() { |
| 160 | 160 | $show_on_screens = array( |
| 161 | 161 | 'dashboard', |
@@ -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 | |
@@ -156,9 +156,9 @@ discard block |
||
| 156 | 156 | * @access private |
| 157 | 157 | * @since 1.4.3 |
| 158 | 158 | */ |
| 159 | - private function define( $name, $value ) { |
|
| 160 | - if ( ! defined( $name ) ) { |
|
| 161 | - define( $name, $value ); |
|
| 159 | + private function define($name, $value) { |
|
| 160 | + if ( ! defined($name)) { |
|
| 161 | + define($name, $value); |
|
| 162 | 162 | } |
| 163 | 163 | } // END define() |
| 164 | 164 | |
@@ -171,29 +171,29 @@ discard block |
||
| 171 | 171 | * @return void |
| 172 | 172 | */ |
| 173 | 173 | public function includes() { |
| 174 | - include_once( dirname( __FILE__ ) . '/includes/class-alnp-autoloader.php' ); // Autoloader. |
|
| 175 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-conditional-functions.php' ); // Conditional functions. |
|
| 176 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-formatting-functions.php' ); // Formatting functions. |
|
| 177 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-themes-supported.php' ); // Handles all supported themes out of the box. |
|
| 178 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-core-functions.php' ); // Contains core functions for the front/back end. |
|
| 174 | + include_once(dirname(__FILE__).'/includes/class-alnp-autoloader.php'); // Autoloader. |
|
| 175 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-conditional-functions.php'); // Conditional functions. |
|
| 176 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-formatting-functions.php'); // Formatting functions. |
|
| 177 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-themes-supported.php'); // Handles all supported themes out of the box. |
|
| 178 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-core-functions.php'); // Contains core functions for the front/back end. |
|
| 179 | 179 | |
| 180 | 180 | // Include theme support. |
| 181 | 181 | alnp_include_theme_support(); |
| 182 | 182 | |
| 183 | 183 | // 3rd Party support. |
| 184 | - include_once( dirname( __FILE__ ) . '/includes/3rd-party/3rd-party.php' ); |
|
| 184 | + include_once(dirname(__FILE__).'/includes/3rd-party/3rd-party.php'); |
|
| 185 | 185 | |
| 186 | 186 | // Customizer. |
| 187 | - include_once( dirname( __FILE__ ) . '/includes/customizer/class-alnp-customizer.php' ); |
|
| 188 | - include_once( dirname( __FILE__ ) . '/includes/customizer/class-alnp-customizer-scripts.php' ); |
|
| 187 | + include_once(dirname(__FILE__).'/includes/customizer/class-alnp-customizer.php'); |
|
| 188 | + include_once(dirname(__FILE__).'/includes/customizer/class-alnp-customizer-scripts.php'); |
|
| 189 | 189 | |
| 190 | 190 | // Include admin class to handle all back-end functions. |
| 191 | - if ( is_admin() ) { |
|
| 192 | - include_once( dirname( __FILE__ ) . '/includes/admin/class-alnp-admin.php' ); // Admin section. |
|
| 191 | + if (is_admin()) { |
|
| 192 | + include_once(dirname(__FILE__).'/includes/admin/class-alnp-admin.php'); // Admin section. |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | // Install. |
| 196 | - require_once( dirname( __FILE__ ) . '/includes/class-alnp-install.php' ); |
|
| 196 | + require_once(dirname(__FILE__).'/includes/class-alnp-install.php'); |
|
| 197 | 197 | } // END includes() |
| 198 | 198 | |
| 199 | 199 | /** |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | * @return void |
| 209 | 209 | */ |
| 210 | 210 | public function load_plugin_textdomain() { |
| 211 | - load_plugin_textdomain( 'auto-load-next-post', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); |
|
| 211 | + load_plugin_textdomain('auto-load-next-post', false, dirname(plugin_basename(__FILE__)).'/languages/'); |
|
| 212 | 212 | } // END load_plugin_textdomain() |
| 213 | 213 | |
| 214 | 214 | /** |
@@ -220,33 +220,33 @@ discard block |
||
| 220 | 220 | */ |
| 221 | 221 | public function alnp_enqueue_scripts() { |
| 222 | 222 | // Load the Javascript if found as a singluar post and the user is not a bot. |
| 223 | - if ( !alnp_is_bot() && is_singular() && get_post_type() == 'post' ) { |
|
| 223 | + if ( ! alnp_is_bot() && is_singular() && get_post_type() == 'post') { |
|
| 224 | 224 | // This checks to see if the JavaScript should load in the footer or not. |
| 225 | 225 | $load_in_footer = alnp_load_js_in_footer(); |
| 226 | 226 | |
| 227 | - $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 ); |
|
| 227 | + $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); |
|
| 228 | 228 | |
| 229 | 229 | // Only load History.js when not in the customizer. |
| 230 | - if ( ! is_customize_preview() ) { |
|
| 231 | - $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 ); |
|
| 230 | + if ( ! is_customize_preview()) { |
|
| 231 | + $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); |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - $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 ); |
|
| 234 | + $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); |
|
| 235 | 235 | |
| 236 | 236 | // Variables for the JavaScript |
| 237 | - wp_localize_script( 'auto-load-next-post-script', 'auto_load_next_post_params', array( |
|
| 237 | + wp_localize_script('auto-load-next-post-script', 'auto_load_next_post_params', array( |
|
| 238 | 238 | 'alnp_version' => AUTO_LOAD_NEXT_POST_VERSION, |
| 239 | - 'alnp_content_container' => get_option( 'auto_load_next_post_content_container' ), |
|
| 240 | - 'alnp_title_selector' => get_option( 'auto_load_next_post_title_selector' ), |
|
| 241 | - 'alnp_navigation_container' => get_option( 'auto_load_next_post_navigation_container' ), |
|
| 242 | - 'alnp_comments_container' => get_option( 'auto_load_next_post_comments_container' ), |
|
| 243 | - 'alnp_remove_comments' => get_option( 'auto_load_next_post_remove_comments' ), |
|
| 244 | - 'alnp_google_analytics' => get_option( 'auto_load_next_post_google_analytics' ), |
|
| 245 | - 'alnp_event_on_load' => get_option( 'auto_load_next_post_on_load_event' ), |
|
| 246 | - 'alnp_event_on_entering' => get_option( 'auto_load_next_post_on_entering_event' ), |
|
| 239 | + 'alnp_content_container' => get_option('auto_load_next_post_content_container'), |
|
| 240 | + 'alnp_title_selector' => get_option('auto_load_next_post_title_selector'), |
|
| 241 | + 'alnp_navigation_container' => get_option('auto_load_next_post_navigation_container'), |
|
| 242 | + 'alnp_comments_container' => get_option('auto_load_next_post_comments_container'), |
|
| 243 | + 'alnp_remove_comments' => get_option('auto_load_next_post_remove_comments'), |
|
| 244 | + 'alnp_google_analytics' => get_option('auto_load_next_post_google_analytics'), |
|
| 245 | + 'alnp_event_on_load' => get_option('auto_load_next_post_on_load_event'), |
|
| 246 | + 'alnp_event_on_entering' => get_option('auto_load_next_post_on_entering_event'), |
|
| 247 | 247 | 'alnp_is_customizer' => $this->is_alnp_using_customizer(), |
| 248 | 248 | 'alnp_load_in_footer' => $load_in_footer |
| 249 | - ) ); |
|
| 249 | + )); |
|
| 250 | 250 | } // END if is_singular() && get_post_type() |
| 251 | 251 | } // END alnp_enqueue_scripts() |
| 252 | 252 | |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | * @return string|false |
| 260 | 260 | */ |
| 261 | 261 | public static function is_alnp_using_customizer() { |
| 262 | - if ( is_customize_preview() ) { |
|
| 262 | + if (is_customize_preview()) { |
|
| 263 | 263 | return "yes"; |
| 264 | 264 | } |
| 265 | 265 | |
@@ -280,19 +280,19 @@ discard block |
||
| 280 | 280 | * @param string $version Optional, can match the version of the plugin or version of the source file. |
| 281 | 281 | * @param bool $footer Optional, can set the JavaScript to load in the footer instead. |
| 282 | 282 | */ |
| 283 | - public static function load_file( $name, $file_path, $is_script = false, $support = array(), $version = '', $footer = false ) { |
|
| 284 | - $url = AUTO_LOAD_NEXT_POST_URL_PATH . $file_path; // URL to the file. |
|
| 285 | - |
|
| 286 | - if ( file_exists( AUTO_LOAD_NEXT_POST_FILE_PATH . $file_path ) ) { |
|
| 287 | - if ( $is_script ) { |
|
| 288 | - if ( !wp_script_is( $name, 'registered' ) ) { |
|
| 289 | - wp_register_script( $name, $url, $support, $version, $footer ); |
|
| 290 | - wp_enqueue_script( $name ); |
|
| 283 | + public static function load_file($name, $file_path, $is_script = false, $support = array(), $version = '', $footer = false) { |
|
| 284 | + $url = AUTO_LOAD_NEXT_POST_URL_PATH.$file_path; // URL to the file. |
|
| 285 | + |
|
| 286 | + if (file_exists(AUTO_LOAD_NEXT_POST_FILE_PATH.$file_path)) { |
|
| 287 | + if ($is_script) { |
|
| 288 | + if ( ! wp_script_is($name, 'registered')) { |
|
| 289 | + wp_register_script($name, $url, $support, $version, $footer); |
|
| 290 | + wp_enqueue_script($name); |
|
| 291 | 291 | } |
| 292 | 292 | } else { |
| 293 | - if ( !wp_style_is( $name, 'registered' ) ) { |
|
| 294 | - wp_register_style( $name, $url ); |
|
| 295 | - wp_enqueue_style( $name ); |
|
| 293 | + if ( ! wp_style_is($name, 'registered')) { |
|
| 294 | + wp_register_style($name, $url); |
|
| 295 | + wp_enqueue_style($name); |
|
| 296 | 296 | } |
| 297 | 297 | } // end if |
| 298 | 298 | } // end if |