@@ -8,60 +8,60 @@ |
||
| 8 | 8 | * @version 1.5.8 |
| 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_format = get_post_format(); // Post Format e.g. video |
| 20 | 20 | |
| 21 | 21 | $post_type = alnp_get_post_type(); // Post Type e.g. single |
| 22 | 22 | |
| 23 | 23 | // Load content before the post content. |
| 24 | - do_action( 'alnp_load_before_content' ); |
|
| 24 | + do_action('alnp_load_before_content'); |
|
| 25 | 25 | |
| 26 | 26 | // Load content before the post content for a specific post format. |
| 27 | - do_action( 'alnp_load_before_content_post_format_' . $post_format ); |
|
| 27 | + do_action('alnp_load_before_content_post_format_'.$post_format); |
|
| 28 | 28 | |
| 29 | 29 | // Load content before the post content for a specific post type. |
| 30 | - do_action( 'alnp_load_before_content_post_type_' . $post_type ); |
|
| 30 | + do_action('alnp_load_before_content_post_type_'.$post_type); |
|
| 31 | 31 | |
| 32 | - if ( false === $post_format ) { |
|
| 32 | + if (false === $post_format) { |
|
| 33 | 33 | /* |
| 34 | 34 | * Include the Post-Type-specific template for the content. |
| 35 | 35 | * layout-___.php (where ___ is the Post Type name). |
| 36 | 36 | */ |
| 37 | - if ( locate_template( alnp_template_location() . 'layout-' . $post_type . '.php') != '' ) { |
|
| 38 | - get_template_part( alnp_template_location() . 'layout', $post_type ); |
|
| 37 | + if (locate_template(alnp_template_location().'layout-'.$post_type.'.php') != '') { |
|
| 38 | + get_template_part(alnp_template_location().'layout', $post_type); |
|
| 39 | 39 | } else { |
| 40 | 40 | // If no specific post type found then fallback to standard layout.php file. |
| 41 | - get_template_part( alnp_template_location() . 'layout' ); |
|
| 41 | + get_template_part(alnp_template_location().'layout'); |
|
| 42 | 42 | } |
| 43 | 43 | } else { |
| 44 | - get_template_part( alnp_template_location() . 'layout', $post_format ); |
|
| 44 | + get_template_part(alnp_template_location().'layout', $post_format); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | // Load content after the post content for a specific post type. |
| 48 | - do_action( 'alnp_load_after_content_post_type_' . $post_type ); |
|
| 48 | + do_action('alnp_load_after_content_post_type_'.$post_type); |
|
| 49 | 49 | |
| 50 | 50 | // Load content after the post content for a specific post format. |
| 51 | - do_action( 'alnp_load_after_content_post_format_' . $post_format ); |
|
| 51 | + do_action('alnp_load_after_content_post_format_'.$post_format); |
|
| 52 | 52 | |
| 53 | 53 | // Load content after the post content. |
| 54 | - do_action( 'alnp_load_after_content' ); |
|
| 54 | + do_action('alnp_load_after_content'); |
|
| 55 | 55 | |
| 56 | 56 | // End the loop. |
| 57 | 57 | endwhile; |
| 58 | 58 | |
| 59 | 59 | // Load content after the loop. |
| 60 | - do_action( 'alnp_load_after_loop' ); |
|
| 60 | + do_action('alnp_load_after_loop'); |
|
| 61 | 61 | |
| 62 | 62 | else : |
| 63 | 63 | |
| 64 | 64 | // Load content if there are no more posts. |
| 65 | - do_action( 'alnp_no_more_posts' ); |
|
| 65 | + do_action('alnp_no_more_posts'); |
|
| 66 | 66 | |
| 67 | 67 | endif; // END if have_posts() |
@@ -11,7 +11,7 @@ discard block |
||
| 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 | |
@@ -20,12 +20,12 @@ discard block |
||
| 20 | 20 | <div class="notice notice-success auto-load-next-post-notice is-dismissible"> |
| 21 | 21 | <div class="auto-load-next-post-notice-inner"> |
| 22 | 22 | <div class="auto-load-next-post-notice-icon"> |
| 23 | - <img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__( 'Auto Load Next Post WordPress Plugin', 'auto-load-next-post' ); ?>" /> |
|
| 23 | + <img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__('Auto Load Next Post WordPress Plugin', 'auto-load-next-post'); ?>" /> |
|
| 24 | 24 | </div> |
| 25 | 25 | |
| 26 | 26 | <div class="auto-load-next-post-notice-content"> |
| 27 | - <h3><?php echo sprintf( esc_html__( 'Thank you for installing %1$s!', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ); ?></h3> |
|
| 28 | - <p><?php echo sprintf( __( 'We detected your theme <strong>%1$s</strong> already supports %2$s. Everything is already setup for you and is ready to increase your pageviews.', 'auto-load-next-post' ), $active_theme->name, esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ); ?></p> |
|
| 27 | + <h3><?php echo sprintf(esc_html__('Thank you for installing %1$s!', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')); ?></h3> |
|
| 28 | + <p><?php echo sprintf(__('We detected your theme <strong>%1$s</strong> already supports %2$s. Everything is already setup for you and is ready to increase your pageviews.', 'auto-load-next-post'), $active_theme->name, esc_html__('Auto Load Next Post', 'auto-load-next-post')); ?></p> |
|
| 29 | 29 | </div> |
| 30 | 30 | </div> |
| 31 | 31 | </div> |
@@ -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 | |
@@ -29,16 +29,16 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public static function init() { |
| 31 | 31 | // Add theme support and preset the theme selectors. |
| 32 | - add_action( 'after_setup_theme', array( __CLASS__, 'add_theme_support' ) ); |
|
| 32 | + add_action('after_setup_theme', array(__CLASS__, 'add_theme_support')); |
|
| 33 | 33 | |
| 34 | 34 | // Filters the location of the repeater template. |
| 35 | - add_filter( 'alnp_template_redirect', array( __CLASS__, 'template_redirect' ) ); |
|
| 35 | + add_filter('alnp_template_redirect', array(__CLASS__, 'template_redirect')); |
|
| 36 | 36 | |
| 37 | 37 | // Filters the repeater template location. |
| 38 | - add_filter( 'alnp_template_location', array( __CLASS__, 'alnp_oceanwp_template_location' ) ); |
|
| 38 | + add_filter('alnp_template_location', array(__CLASS__, 'alnp_oceanwp_template_location')); |
|
| 39 | 39 | |
| 40 | 40 | // Remove Auto Load Next Post compatible post navigation. |
| 41 | - remove_action( 'alnp_load_after_content', 'auto_load_next_post_navigation', 1, 10 ); |
|
| 41 | + remove_action('alnp_load_after_content', 'auto_load_next_post_navigation', 1, 10); |
|
| 42 | 42 | } // END init() |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @return string |
| 49 | 49 | */ |
| 50 | 50 | public static function template_redirect() { |
| 51 | - return AUTO_LOAD_NEXT_POST_FILE_PATH . '/template/theme-support/oceanwp/content-alnp.php'; |
|
| 51 | + return AUTO_LOAD_NEXT_POST_FILE_PATH.'/template/theme-support/oceanwp/content-alnp.php'; |
|
| 52 | 52 | } // END template_redirect() |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -69,14 +69,14 @@ discard block |
||
| 69 | 69 | * @static |
| 70 | 70 | */ |
| 71 | 71 | public static function add_theme_support() { |
| 72 | - add_theme_support( 'auto-load-next-post', array( |
|
| 72 | + add_theme_support('auto-load-next-post', array( |
|
| 73 | 73 | 'content_container' => 'div.site-content', |
| 74 | 74 | 'title_selector' => '.entry-title', |
| 75 | 75 | 'navigation_container' => 'nav.post-navigation', |
| 76 | 76 | 'comments_container' => 'section#comments', |
| 77 | 77 | 'load_js_in_footer' => 'no', |
| 78 | 78 | 'lock_js_in_footer' => 'no', |
| 79 | - ) ); |
|
| 79 | + )); |
|
| 80 | 80 | } // END add_theme_support() |
| 81 | 81 | |
| 82 | 82 | } // END class |
@@ -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 | /** |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | /** |
| 105 | 105 | * Auto Load Next Post is fully loaded. |
| 106 | 106 | */ |
| 107 | - do_action( 'auto_load_next_post_loaded' ); |
|
| 107 | + do_action('auto_load_next_post_loaded'); |
|
| 108 | 108 | } // END __construct() |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -115,10 +115,10 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | public function init_hooks() { |
| 117 | 117 | // Load translation files. |
| 118 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
| 118 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
| 119 | 119 | |
| 120 | 120 | // Load Auto Load Next Post scripts on the frontend. |
| 121 | - add_action( 'wp_enqueue_scripts', array( $this, 'alnp_enqueue_scripts' ) ); |
|
| 121 | + add_action('wp_enqueue_scripts', array($this, 'alnp_enqueue_scripts')); |
|
| 122 | 122 | } // END init_hooks() |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | $this->define('AUTO_LOAD_NEXT_POST_FILE', __FILE__); |
| 134 | 134 | $this->define('AUTO_LOAD_NEXT_POST_SLUG', 'auto-load-next-post'); |
| 135 | 135 | |
| 136 | - $this->define('AUTO_LOAD_NEXT_POST_URL_PATH', untrailingslashit( plugins_url( '/', __FILE__ ) ) ); |
|
| 137 | - $this->define('AUTO_LOAD_NEXT_POST_FILE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); |
|
| 136 | + $this->define('AUTO_LOAD_NEXT_POST_URL_PATH', untrailingslashit(plugins_url('/', __FILE__))); |
|
| 137 | + $this->define('AUTO_LOAD_NEXT_POST_FILE_PATH', untrailingslashit(plugin_dir_path(__FILE__))); |
|
| 138 | 138 | $this->define('AUTO_LOAD_NEXT_POST_TEMPLATE_PATH', 'auto-load-next-post/'); |
| 139 | 139 | |
| 140 | 140 | $this->define('AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE', '4.4'); |
@@ -158,9 +158,9 @@ discard block |
||
| 158 | 158 | * @access private |
| 159 | 159 | * @since 1.4.3 |
| 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,26 +173,26 @@ 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-conditional-functions.php' ); // Conditional functions. |
|
| 178 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-formatting-functions.php' ); // Formatting functions. |
|
| 179 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-themes-supported.php' ); // Handles all supported themes out of the box. |
|
| 180 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-core-functions.php' ); // Contains core functions for the front/back end. |
|
| 176 | + include_once(dirname(__FILE__).'/includes/class-alnp-autoloader.php'); // Autoloader. |
|
| 177 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-conditional-functions.php'); // Conditional functions. |
|
| 178 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-formatting-functions.php'); // Formatting functions. |
|
| 179 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-themes-supported.php'); // Handles all supported themes out of the box. |
|
| 180 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-core-functions.php'); // Contains core functions for the front/back end. |
|
| 181 | 181 | |
| 182 | 182 | // Include theme support. |
| 183 | 183 | alnp_include_theme_support(); |
| 184 | 184 | |
| 185 | 185 | // Customizer. |
| 186 | - include_once( dirname( __FILE__ ) . '/includes/customizer/class-alnp-customizer.php' ); |
|
| 187 | - include_once( dirname( __FILE__ ) . '/includes/customizer/class-alnp-customizer-scripts.php' ); |
|
| 186 | + include_once(dirname(__FILE__).'/includes/customizer/class-alnp-customizer.php'); |
|
| 187 | + include_once(dirname(__FILE__).'/includes/customizer/class-alnp-customizer-scripts.php'); |
|
| 188 | 188 | |
| 189 | 189 | // Include admin class to handle all back-end functions. |
| 190 | - if ( is_admin() ) { |
|
| 191 | - include_once( dirname( __FILE__ ) . '/includes/admin/class-alnp-admin.php' ); // Admin section. |
|
| 190 | + if (is_admin()) { |
|
| 191 | + include_once(dirname(__FILE__).'/includes/admin/class-alnp-admin.php'); // Admin section. |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | // Install. |
| 195 | - require_once( dirname( __FILE__ ) . '/includes/class-alnp-install.php' ); |
|
| 195 | + require_once(dirname(__FILE__).'/includes/class-alnp-install.php'); |
|
| 196 | 196 | } // END includes() |
| 197 | 197 | |
| 198 | 198 | /** |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | * @return void |
| 208 | 208 | */ |
| 209 | 209 | public function load_plugin_textdomain() { |
| 210 | - load_plugin_textdomain( 'auto-load-next-post', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); |
|
| 210 | + load_plugin_textdomain('auto-load-next-post', false, dirname(plugin_basename(__FILE__)).'/languages/'); |
|
| 211 | 211 | } // END load_plugin_textdomain() |
| 212 | 212 | |
| 213 | 213 | /** |
@@ -219,33 +219,33 @@ discard block |
||
| 219 | 219 | */ |
| 220 | 220 | public function alnp_enqueue_scripts() { |
| 221 | 221 | // Load the Javascript if found as a singluar post and the user is not a bot. |
| 222 | - if ( !alnp_is_bot() && is_singular() && get_post_type() == 'post' ) { |
|
| 222 | + if ( ! alnp_is_bot() && is_singular() && get_post_type() == 'post') { |
|
| 223 | 223 | // This checks to see if the JavaScript should load in the footer or not. |
| 224 | 224 | $load_in_footer = alnp_load_js_in_footer(); |
| 225 | 225 | |
| 226 | - $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 ); |
|
| 226 | + $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 | 227 | |
| 228 | 228 | // Only load History.js when not in the customizer. |
| 229 | - if ( ! is_customize_preview() ) { |
|
| 230 | - $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 ); |
|
| 229 | + if ( ! is_customize_preview()) { |
|
| 230 | + $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); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - $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 ); |
|
| 233 | + $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 | 234 | |
| 235 | 235 | // Variables for the JavaScript |
| 236 | - wp_localize_script( 'auto-load-next-post-script', 'auto_load_next_post_params', array( |
|
| 236 | + wp_localize_script('auto-load-next-post-script', 'auto_load_next_post_params', array( |
|
| 237 | 237 | 'alnp_version' => AUTO_LOAD_NEXT_POST_VERSION, |
| 238 | - 'alnp_content_container' => get_option( 'auto_load_next_post_content_container' ), |
|
| 239 | - 'alnp_title_selector' => get_option( 'auto_load_next_post_title_selector' ), |
|
| 240 | - 'alnp_navigation_container' => get_option( 'auto_load_next_post_navigation_container' ), |
|
| 241 | - 'alnp_comments_container' => get_option( 'auto_load_next_post_comments_container' ), |
|
| 242 | - 'alnp_remove_comments' => get_option( 'auto_load_next_post_remove_comments' ), |
|
| 243 | - 'alnp_google_analytics' => get_option( 'auto_load_next_post_google_analytics' ), |
|
| 244 | - 'alnp_event_on_load' => get_option( 'auto_load_next_post_on_load_event' ), |
|
| 245 | - 'alnp_event_on_entering' => get_option( 'auto_load_next_post_on_entering_event' ), |
|
| 238 | + 'alnp_content_container' => get_option('auto_load_next_post_content_container'), |
|
| 239 | + 'alnp_title_selector' => get_option('auto_load_next_post_title_selector'), |
|
| 240 | + 'alnp_navigation_container' => get_option('auto_load_next_post_navigation_container'), |
|
| 241 | + 'alnp_comments_container' => get_option('auto_load_next_post_comments_container'), |
|
| 242 | + 'alnp_remove_comments' => get_option('auto_load_next_post_remove_comments'), |
|
| 243 | + 'alnp_google_analytics' => get_option('auto_load_next_post_google_analytics'), |
|
| 244 | + 'alnp_event_on_load' => get_option('auto_load_next_post_on_load_event'), |
|
| 245 | + 'alnp_event_on_entering' => get_option('auto_load_next_post_on_entering_event'), |
|
| 246 | 246 | 'alnp_is_customizer' => $this->is_alnp_using_customizer(), |
| 247 | 247 | 'alnp_load_in_footer' => $load_in_footer |
| 248 | - ) ); |
|
| 248 | + )); |
|
| 249 | 249 | } // END if is_singular() && get_post_type() |
| 250 | 250 | } // END alnp_enqueue_scripts() |
| 251 | 251 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | * @return string|boolean |
| 259 | 259 | */ |
| 260 | 260 | public static function is_alnp_using_customizer() { |
| 261 | - if ( is_customize_preview() ) { |
|
| 261 | + if (is_customize_preview()) { |
|
| 262 | 262 | return "yes"; |
| 263 | 263 | } |
| 264 | 264 | |
@@ -280,21 +280,21 @@ discard block |
||
| 280 | 280 | * @param bool $footer Optional, can set the JavaScript to load in the footer instead. |
| 281 | 281 | * @global string $wp_version |
| 282 | 282 | */ |
| 283 | - public static function load_file( $name, $file_path, $is_script = false, $support = array(), $version = '', $footer = false ) { |
|
| 283 | + public static function load_file($name, $file_path, $is_script = false, $support = array(), $version = '', $footer = false) { |
|
| 284 | 284 | global $wp_version; |
| 285 | 285 | |
| 286 | - $url = AUTO_LOAD_NEXT_POST_URL_PATH . $file_path; // URL to the file. |
|
| 286 | + $url = AUTO_LOAD_NEXT_POST_URL_PATH.$file_path; // URL to the file. |
|
| 287 | 287 | |
| 288 | - if ( file_exists( AUTO_LOAD_NEXT_POST_FILE_PATH . $file_path ) ) { |
|
| 289 | - if ( $is_script ) { |
|
| 290 | - if ( !wp_script_is( $name, 'registered' ) ) { |
|
| 291 | - wp_register_script( $name, $url, $support, $version, $footer ); |
|
| 292 | - wp_enqueue_script( $name ); |
|
| 288 | + if (file_exists(AUTO_LOAD_NEXT_POST_FILE_PATH.$file_path)) { |
|
| 289 | + if ($is_script) { |
|
| 290 | + if ( ! wp_script_is($name, 'registered')) { |
|
| 291 | + wp_register_script($name, $url, $support, $version, $footer); |
|
| 292 | + wp_enqueue_script($name); |
|
| 293 | 293 | } |
| 294 | 294 | } else { |
| 295 | - if ( !wp_style_is( $name, 'registered' ) ) { |
|
| 296 | - wp_register_style( $name, $url ); |
|
| 297 | - wp_enqueue_style( $name ); |
|
| 295 | + if ( ! wp_style_is($name, 'registered')) { |
|
| 296 | + wp_register_style($name, $url); |
|
| 297 | + wp_enqueue_style($name); |
|
| 298 | 298 | } |
| 299 | 299 | } // end if |
| 300 | 300 | } // end if |