Plugin Directory

Changeset 3162546


Ignore:
Timestamp:
10/04/2024 08:08:32 AM (18 months ago)
Author:
wpscreens
Message:

fixed slider option 04/10/24

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wpscreens/tags/2.5.3/admin/class-wp-screens-admin.php

    r3158640 r3162546  
    107107
    108108        /**
    109          * This function is provided for demonstration purposes only.
    110          *
    111          * An instance of this class should be passed to the run() function
    112          * defined in Wp_Screens_Loader as all of the hooks are defined
    113          * in that particular class.
    114          *
    115          * The Wp_Screens_Loader will then create the relationship
    116          * between the defined hooks and the functions defined in this
    117          * class.
    118          */
    119         wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/wp-screens-admin.js', array('jquery'), $this->version, false);
     109     * This function is provided for demonstration purposes only.
     110     *
     111     * An instance of this class should be passed to the run() function
     112     * defined in Wp_Screens_Loader as all of the hooks are defined
     113     * in that particular class.
     114     *
     115     * The Wp_Screens_Loader will then create the relationship
     116     * between the defined hooks and the functions defined in this
     117     * class.
     118     */
     119
     120    // Deregister WordPress jQuery and add jQuery from a CDN
     121    wp_deregister_script('jquery');
     122    wp_register_script('jquery', 'https://code.jquery.com/jquery-3.6.0.min.js', false, '3.6.0', true);
     123    wp_enqueue_script('jquery');
     124
     125    $time = time();
     126
     127    // Enqueue your plugin's admin script with cache-busting parameter
     128    wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/wp-screens-admin.js', array('jquery'), $this->version . '-' . $time, false);
    120129    }
    121130
     
    719728<script>
    720729jQuery(document).ready(function() {
    721      $(".wpscr_slider-wrapper").hide();
     730    $(".wpscr_slider-wrapper").hide();
    722731    jQuery('#slect-slider-type').on('change', function() {
    723         var slider = jQuery(this).find(":selected").val();
    724         if(slider) {
    725             jQuery('.wpscr_slider-wrapper').hide();
    726             jQuery('.wpscr_slider-wrapper#'+slider).show();
    727         }
    728     });
    729 
    730     var savedSlider = jQuery('.saved-slider').attr('id');
    731     if (savedSlider) {
    732         jQuery('.wpscr_slider-wrapper#'+savedSlider).show();
    733     }
     732        var slider = jQuery(this).find(":selected").val();
     733        if (slider) {
     734            jQuery('.wpscr_slider-wrapper').hide();
     735            jQuery('.wpscr_slider-wrapper#' + slider).show();
     736        }
     737    });
     738
     739    var savedSlider = jQuery('.saved-slider').attr('id');
     740    if (savedSlider) {
     741        jQuery('.wpscr_slider-wrapper#' + savedSlider).show();
     742    }
    734743});
    735744</script>
Note: See TracChangeset for help on using the changeset viewer.