Changeset 2644453
- Timestamp:
- 12/15/2021 10:47:58 AM (4 years ago)
- Location:
- wc-shipping-method-description/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
shipping-method-description-for-woocommerce.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wc-shipping-method-description/trunk/readme.txt
r2635793 r2644453 5 5 Tested up to: 5.8 6 6 Requires PHP: 5.3 7 Stable tag: 1.2. 07 Stable tag: 1.2.1 8 8 License: GPLv3 or later License 9 9 WC requires at least: 2.6 … … 28 28 == Changelog == 29 29 30 = 1.2.1 = 31 * Fix: Polylang/WPML integration not working 32 30 33 = 1.2.0 = 31 34 * Feature: allow HTML tags in description -
wc-shipping-method-description/trunk/shipping-method-description-for-woocommerce.php
r2635793 r2644453 6 6 * Author: Thomas Charbit 7 7 * Author URI: https://thomascharbit.fr 8 * Version: 1.2. 08 * Version: 1.2.1 9 9 * License: GPLv3 or later License 10 10 * Requires at least: 4.4 … … 32 32 add_action( 'init', 'smdfw_init', 100 ); 33 33 function smdfw_init() { 34 // Add shipping methods filters 35 $shipping_methods = WC()->shipping->get_shipping_methods(); 36 foreach ( $shipping_methods as $id => $shipping_method ) { 37 add_filter( "woocommerce_shipping_instance_form_fields_$id", 'smdfw_add_form_fields' ); 38 } 34 39 // Add Polylang integration if needed 35 40 if ( function_exists( 'pll_current_language' ) ) { … … 39 44 if ( function_exists( 'icl_object_id' ) && ! function_exists( 'pll_current_language' ) ) { 40 45 require_once SMDFW_DIR . 'includes/smdfw-wpml.php'; 41 }42 43 // Add shipping methods filters44 $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' );47 46 } 48 47 } … … 96 95 if ( array_key_exists( 'description', $meta_data ) ) { 97 96 $description = apply_filters( 'smdfw_description_output', html_entity_decode( $meta_data['description'] ), $method ); 98 $html = '<div><small class="smdfw">' . wp_kses( $description, wp_kses_allowed_html( 'post' ) ) . '</small></div>';97 $html = '<div><small class="smdfw">' . wp_kses( $description, wp_kses_allowed_html( 'post' ) ) . '</small></div>'; 99 98 echo apply_filters( 'smdfw_description_output_html', $html, $description, $method ); 100 99 }
Note: See TracChangeset
for help on using the changeset viewer.