Changeset 2633227
- Timestamp:
- 11/21/2021 10:55:06 PM (4 years ago)
- Location:
- wc-shipping-method-description
- Files:
-
- 2 edited
- 5 copied
-
tags/1.1.0 (copied) (copied from wc-shipping-method-description/trunk)
-
tags/1.1.0/includes (copied) (copied from wc-shipping-method-description/trunk/includes)
-
tags/1.1.0/phpcs.xml (copied) (copied from wc-shipping-method-description/trunk/phpcs.xml)
-
tags/1.1.0/readme.txt (copied) (copied from wc-shipping-method-description/trunk/readme.txt) (1 diff)
-
tags/1.1.0/shipping-method-description-for-woocommerce.php (copied) (copied from wc-shipping-method-description/trunk/shipping-method-description-for-woocommerce.php) (3 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/shipping-method-description-for-woocommerce.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wc-shipping-method-description/tags/1.1.0/readme.txt
r2584056 r2633227 28 28 == Changelog == 29 29 30 = 1.1.0 = 31 * Added Table Rate Shipping compatibility 32 * Fix: function redeclaration error with Polylang integration 33 30 34 = 1.0.0 = 31 35 * Initial release -
wc-shipping-method-description/tags/1.1.0/shipping-method-description-for-woocommerce.php
r2584018 r2633227 6 6 * Author: Thomas Charbit 7 7 * Author URI: https://thomascharbit.fr 8 * Version: 1. 0.08 * Version: 1.1.0 9 9 * License: GPLv3 or later License 10 10 * Requires at least: 4.4 … … 28 28 29 29 /** 30 * Add Polylang/WPML integration if needed30 * Init plugin 31 31 **/ 32 32 add_action( 'init', 'smdfw_init', 100 ); 33 33 function smdfw_init() { 34 // Add Polylang integration if needed 34 35 if ( function_exists( 'pll_current_language' ) ) { 35 36 require_once SMDFW_DIR . 'includes/smdfw-polylang.php'; 36 37 } 38 // Add WPML integration if needed 39 if ( function_exists( 'icl_object_id' ) && ! function_exists( 'pll_current_language' ) ) { 40 require_once SMDFW_DIR . 'includes/smdfw-wpml.php'; 41 } 37 42 38 if ( function_exists( 'icl_object_id' ) ) { 39 require_once SMDFW_DIR . 'includes/smdfw-wpml.php'; 43 // Add shipping methods filters 44 $shipping_methods = WC()->shipping->get_shipping_methods(); 45 foreach ( $shipping_methods as $id => $shipping_method ) { 46 add_filter( "woocommerce_shipping_instance_form_fields_$id", 'smdfw_add_form_fields' ); 40 47 } 41 48 } … … 51 58 $message = '<div class="error"><p>' . $error . '</p></div>'; 52 59 echo $message; 53 }54 }55 56 /**57 * Init plugin58 */59 add_action( 'woocommerce_loaded', 'smdfw_add_filters' );60 function smdfw_add_filters() {61 $shipping_methods = WC()->shipping->get_shipping_methods();62 63 foreach ( $shipping_methods as $id => $shipping_method ) {64 add_filter( "woocommerce_shipping_instance_form_fields_$id", 'smdfw_add_form_fields' );65 60 } 66 61 } -
wc-shipping-method-description/trunk/readme.txt
r2584056 r2633227 28 28 == Changelog == 29 29 30 = 1.1.0 = 31 * Added Table Rate Shipping compatibility 32 * Fix: function redeclaration error with Polylang integration 33 30 34 = 1.0.0 = 31 35 * Initial release -
wc-shipping-method-description/trunk/shipping-method-description-for-woocommerce.php
r2584018 r2633227 6 6 * Author: Thomas Charbit 7 7 * Author URI: https://thomascharbit.fr 8 * Version: 1. 0.08 * Version: 1.1.0 9 9 * License: GPLv3 or later License 10 10 * Requires at least: 4.4 … … 28 28 29 29 /** 30 * Add Polylang/WPML integration if needed30 * Init plugin 31 31 **/ 32 32 add_action( 'init', 'smdfw_init', 100 ); 33 33 function smdfw_init() { 34 // Add Polylang integration if needed 34 35 if ( function_exists( 'pll_current_language' ) ) { 35 36 require_once SMDFW_DIR . 'includes/smdfw-polylang.php'; 36 37 } 38 // Add WPML integration if needed 39 if ( function_exists( 'icl_object_id' ) && ! function_exists( 'pll_current_language' ) ) { 40 require_once SMDFW_DIR . 'includes/smdfw-wpml.php'; 41 } 37 42 38 if ( function_exists( 'icl_object_id' ) ) { 39 require_once SMDFW_DIR . 'includes/smdfw-wpml.php'; 43 // Add shipping methods filters 44 $shipping_methods = WC()->shipping->get_shipping_methods(); 45 foreach ( $shipping_methods as $id => $shipping_method ) { 46 add_filter( "woocommerce_shipping_instance_form_fields_$id", 'smdfw_add_form_fields' ); 40 47 } 41 48 } … … 51 58 $message = '<div class="error"><p>' . $error . '</p></div>'; 52 59 echo $message; 53 }54 }55 56 /**57 * Init plugin58 */59 add_action( 'woocommerce_loaded', 'smdfw_add_filters' );60 function smdfw_add_filters() {61 $shipping_methods = WC()->shipping->get_shipping_methods();62 63 foreach ( $shipping_methods as $id => $shipping_method ) {64 add_filter( "woocommerce_shipping_instance_form_fields_$id", 'smdfw_add_form_fields' );65 60 } 66 61 }
Note: See TracChangeset
for help on using the changeset viewer.