Up to 50 percent off

Forum Replies Created

Viewing 1 Topics - 1 through 1 (of 1 total)
Author Posts
April 14, 2014 at 5:52 pm in reply to: Loading of scripts 18750
Jonas Jonas

Hello,

as far as I can see in the code (version 2.1.9) it was only changed for the plugin scripts, but not for the scripts of wpuf itself. The Google Maps API, frontend-forms.css and frontend-form.js are still loaded on every WordPress page independent of the “Load Scripts” option.

    function enqueue_scripts() {
        
        $path = plugins_url( '', __FILE__ );
        $scheme = is_ssl() ? 'https' : 'http';
        
<strong>        wp_enqueue_script( 'google-maps', $scheme . '://maps.google.com/maps/api/js?sensor=true' );
        wp_enqueue_style( 'wpuf-css', $path . '/css/frontend-forms.css' );
        wp_enqueue_script( 'wpuf-form', $path . '/js/frontend-form.js', array('jquery') );</strong>
        
        if ( wpuf_get_option( 'load_script', 'wpuf_general', 'on') == 'on') {
            $this->plugin_scripts();
        } else if ( wpuf_has_shortcode( 'wpuf_form' ) || wpuf_has_shortcode( 'wpuf_edit' ) || wpuf_has_shortcode( 'wpuf_profile' ) || wpuf_has_shortcode( 'wpuf_dashboard' ) ) {
            $this->plugin_scripts();
        }
    }

Regards
Jonas

Viewing 1 Topics - 1 through 1 (of 1 total)