Changeset 1859624
- Timestamp:
- 04/17/2018 08:43:48 AM (8 years ago)
- Location:
- woo-variations-select2/trunk
- Files:
-
- 3 edited
-
js/woo-variations-select2.min.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
woo-variations-select2.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-variations-select2/trunk/js/woo-variations-select2.min.js
r1716576 r1859624 1 jQuery(document).ready(function( r){var a=r(".variations_form .variations");r(".variations_form .variations").find("select").select2({minimumResultsForSearch:-1,dropdownParent:a})});1 jQuery(document).ready(function(e){e.each(e(".single-product select[data-attribute_name]"),function(t,n){e(n).select2({minimumResultsForSearch:-1,dropdownParent:e(n).closest(".variations")})})}); -
woo-variations-select2/trunk/readme.txt
r1716576 r1859624 3 3 Tags: woocommerce, variations, select2 4 4 Requires at least: 4.6 5 Tested up to: 4. 8.16 Stable tag: 1.0. 15 Tested up to: 4.9.5 6 Stable tag: 1.0.2 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 24 24 25 25 == Changelog == 26 ### 1.0.2 27 28 * Changed selector for better compatibility with other plugins. 29 26 30 ### 1.0.1 27 31 -
woo-variations-select2/trunk/woo-variations-select2.php
r1716576 r1859624 4 4 Description: A simple plugin that enables Select2 for WooCommerce variations select boxes 5 5 Author: Sti3bas 6 Version: 1.0. 16 Version: 1.0.2 7 7 Author URI: https://github.com/sti3bas 8 8 */ … … 11 11 * Check if WooCommerce is active 12 12 **/ 13 if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) )) {14 add_action( 'admin_notices', 'woovs2_woocommerce_inactive_notice');15 return;13 if (! in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) { 14 add_action('admin_notices', 'woovs2_woocommerce_inactive_notice'); 15 return; 16 16 } 17 17 18 function woovs2_woocommerce_inactive_notice() { 19 ?> 18 function woovs2_woocommerce_inactive_notice() 19 { 20 ?> 20 21 <div id="message" class="error"> 21 <p><?=__( 'WooCommerce variations Select2 is inactive. The WooCommerce plugin must be active for WooCommerce variations Select2 to work. Please install & activate WooCommerce.', 'woocommerce-variations-select2' )?></p> 22 <p> 23 <?php echo __('WooCommerce variations Select2 is inactive. The WooCommerce plugin must be active for WooCommerce variations Select2 to work. Please install & activate WooCommerce.', 'woocommerce-variations-select2')?> 24 </p> 22 25 </div> 23 26 <?php 24 27 } 25 28 26 function woovs2_enqueue_scripts() { 29 function woovs2_enqueue_scripts() 30 { 31 $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; 27 32 28 $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 33 if (! wp_script_is('select2', 'enqueued')) { 34 wp_enqueue_script('select2', WC()->plugin_url() . '/assets/js/select2/select2.full' . $suffix . '.js', ['jquery']); 35 } 29 36 30 if( ! wp_script_is( 'select2', 'enqueued' )) {31 wp_enqueue_script( 'select2', WC()->plugin_url() . '/assets/js/select2/select2.full' . $suffix . '.js', array('jquery'));32 }37 if (! wp_style_is('select2', 'enqueued')) { 38 wp_enqueue_style('select2', WC()->plugin_url() . '/assets/css/select2.css', []); 39 } 33 40 34 if( ! wp_style_is( 'select2', 'enqueued' ) ) { 35 wp_enqueue_style( 'select2', WC()->plugin_url() . '/assets/css/select2.css', array() ); 36 } 37 38 wp_enqueue_script( 'woo-select2', plugin_dir_url( __FILE__ ) . 'js/woo-variations-select2' . $suffix . '.js', array('jquery', 'select2') ); 41 wp_enqueue_script('woo-select2', plugin_dir_url(__FILE__) . 'js/woo-variations-select2' . $suffix . '.js', ['jquery', 'select2']); 39 42 } 40 43 41 add_action( 'wp_enqueue_scripts', 'woovs2_enqueue_scripts');44 add_action('wp_enqueue_scripts', 'woovs2_enqueue_scripts'); 42 45 43 46 ?>
Note: See TracChangeset
for help on using the changeset viewer.