function cf7_cognalys_enqueue_scripts()
{
    $settings = get_option('cf7_cognalys_addon');
    if ($settings['cognalys_enabled'] == 1) {
        $in_footer = true;
        if ('header' === wpcf7_load_js()) {
            $in_footer = false;
        }
        wp_enqueue_script('jquery-intl-tel-input', cf7_cognalys_plugin_url('assets/js/intlTelInput.min.js'), array('jquery', 'jquery-form'), CF7COGADDON_VERSION, $in_footer);
        wp_enqueue_script('contact-form-7-cognalys', cf7_cognalys_plugin_url('assets/js/script.js'), array('jquery', 'jquery-form'), CF7COGADDON_VERSION, $in_footer);
        wp_enqueue_script('jquery-ui-dialog');
    }
}
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.51.0-2014.06.20', 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 ...', 'contact-form-7'));
    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');
}
示例#3
0
function wpcf7_html5_fallback()
{
    if (!wpcf7_support_html5_fallback()) {
        return;
    }
    if (wpcf7_load_js()) {
        wp_enqueue_script('jquery-ui-datepicker');
        wp_enqueue_script('jquery-ui-spinner');
    }
    if (wpcf7_load_css()) {
        wp_enqueue_style('jquery-ui-smoothness', wpcf7_plugin_url('includes/js/jquery-ui/themes/smoothness/jquery-ui.min.css'), array(), '1.10.3', 'screen');
    }
}