function wpcf7_enqueue_scripts() { // jquery.form.js originally bundled with WordPress is out of date and deprecated // so we need to deregister it and re-register the latest one wp_deregister_script('jquery-form'); wp_register_script('jquery-form', wpcf7_plugin_url('includes/js/jquery.form.min.js'), array('jquery'), '3.40.0-2013.08.13', true); $in_footer = true; if ('header' === WPCF7_LOAD_JS) { $in_footer = false; } wp_enqueue_script('contact-form-7', wpcf7_plugin_url('includes/js/scripts.js'), array('jquery', 'jquery-form'), WPCF7_VERSION, $in_footer); $_wpcf7 = array('loaderUrl' => wpcf7_ajax_loader(), 'sending' => __('Sending ...', 'wpcf7')); if (defined('WP_CACHE') && WP_CACHE) { $_wpcf7['cached'] = 1; } if (wpcf7_support_html5_fallback()) { $_wpcf7['jqueryUi'] = 1; } wp_localize_script('contact-form-7', '_wpcf7', $_wpcf7); do_action('wpcf7_enqueue_scripts'); }
/** * Enqueque Scripts */ function spyropress_register_scripts() { $options = get_post_meta(get_the_ID(), '_page_options', true); /** * Register Scripts */ // threaded comments if (is_single() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } // Plugins wp_register_script('bootstrap', assets() . 'vendor/bootstrap/bootstrap.js', false, false, true); wp_register_script('theme-common', assets() . 'vendor/common/common.js', false, false, true); wp_register_script('jquery-appear', assets() . 'vendor/jquery.appear/jquery.appear.js', false, false, true); wp_register_script('jquery-cookie', assets() . 'vendor/jquery-cookie/jquery-cookie.js', false, false, true); wp_register_script('jquery-easing', assets() . 'vendor/jquery.easing/jquery.easing.js', false, false, true); wp_register_script('jquery-easy-pie-chart', assets() . 'vendor/jquery.easy-pie-chart/jquery.easy-pie-chart.js', false, false, true); wp_register_script('jquery-flipshow', assets() . 'vendor/circle-flip-slideshow/js/jquery.flipshow.js', false, false, true); wp_register_script('jquery-isotope', assets() . 'vendor/isotope/jquery.isotope.js', false, false, true); wp_register_script('jquery-jflickrfeed', assets() . 'vendor/jflickrfeed/jflickrfeed.js', false, false, true); wp_register_script('jquery-magnific', assets() . 'vendor/magnific-popup/jquery.magnific-popup.js', false, false, true); wp_register_script('jquery-owl-carousel', assets() . 'vendor/owlcarousel/owl.carousel.js', false, false, true); wp_register_script('jquery-stellar', assets() . 'vendor/jquery.stellar/jquery.stellar.js', false, false, true); wp_register_script('jquery-validate', assets() . 'vendor/jquery.validation/jquery.validation.js', false, false, true); wp_register_script('jquery-vide', assets() . 'vendor/vide/jquery.vide.js', false, false, true); wp_register_script('nivoslider', assets() . 'vendor/nivo-slider/jquery.nivo.slider.js', false, false, true); wp_register_script('style-switcher', assets() . 'master/style-switcher/style.switcher.js', false, false, true); wp_register_script('theme', assets() . 'js/theme.js', false, false, true); wp_register_script('theme-init', assets() . 'js/theme.init.js', false, false, true); //wp_register_script( 'twitterjs', assets() . 'vendor/twitterjs/twitter.js', false, false, true ); $deps = array('jquery-appear', 'jquery-easing', 'jquery-cookie'); if (current_theme_supports('theme-demo')) { $deps[] = 'style-switcher'; } $deps = array_merge($deps, array('bootstrap', 'theme-common', 'jquery-validate', 'jquery-stellar', 'jquery-easy-pie-chart', 'jquery-owl-carousel', 'jquery-jflickrfeed', 'jquery-flipshow', 'jquery-magnific', 'nivoslider', 'jquery-vide')); // contact form 7 if (defined('WPCF7_VERSION')) { $deps[] = 'contact-form-7'; } $deps[] = 'theme'; $deps[] = 'theme-init'; // custom scripts wp_register_script('custom-script', assets_js() . 'custom.js', $deps, '2.8', true); /** * Enqueue All */ wp_enqueue_script('custom-script'); $ajax_loader = function_exists('wpcf7_ajax_loader') ? wpcf7_ajax_loader() : ''; $theme_settings = array('ajaxURL' => admin_url('admin-ajax.php'), 'twitter_feed' => admin_url('admin-ajax.php?action=spyropress_twitter_tweets'), 'sending' => __('Sending ...', 'wpcf7'), 'assets' => assets(), 'is_sticky' => get_setting('sticky_header', '')); wp_localize_script('jquery-easing', 'theme_settings', $theme_settings); }