Changeset 3162546
- Timestamp:
- 10/04/2024 08:08:32 AM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wpscreens/tags/2.5.3/admin/class-wp-screens-admin.php
r3158640 r3162546 107 107 108 108 /** 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); 120 129 } 121 130 … … 719 728 <script> 720 729 jQuery(document).ready(function() { 721 $(".wpscr_slider-wrapper").hide();730 $(".wpscr_slider-wrapper").hide(); 722 731 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 } 734 743 }); 735 744 </script>
Note: See TracChangeset
for help on using the changeset viewer.