Plugin Directory

Changeset 2728045


Ignore:
Timestamp:
05/22/2022 03:14:08 PM (4 years ago)
Author:
thomascharbit
Message:

Fix: WPML description translation for each method instance

Location:
wc-shipping-method-description/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wc-shipping-method-description/trunk/includes/smdfw-wpml.php

    r2665966 r2728045  
    1111$zone = new WC_Shipping_Zone( 0 ); // Rest of the the world.
    1212foreach ( $zone->get_shipping_methods() as $method ) {
    13     do_action( 'wpml_register_single_string', 'admin_texts_woocommerce_shipping', $method->id . '_shipping_method_description', $method->get_option( 'description' ) );
     13    do_action( 'wpml_register_single_string', 'admin_texts_woocommerce_shipping',  'shipping_method_' . $method->instance_id . '_description', $method->get_option( 'description' ) );
    1414}
    1515
    1616foreach ( WC_Shipping_Zones::get_zones() as $zone ) {
    1717    foreach ( $zone['shipping_methods'] as $method ) {
    18         do_action( 'wpml_register_single_string', 'admin_texts_woocommerce_shipping', $method->id . '_shipping_method_description', $method->get_option( 'description' ) );
     18        do_action( 'wpml_register_single_string', 'admin_texts_woocommerce_shipping', 'shipping_method_' . $method->instance_id . '_description', $method->get_option( 'description' ) );
    1919    }
    2020}
     
    2525add_filter( 'smdfw_description_output', 'smdfw_translate_description', 10, 2 );
    2626function smdfw_translate_description( $description, $method ) {
    27     return apply_filters( 'wpml_translate_single_string', $description, 'admin_texts_woocommerce_shipping', $method->method_id . '_shipping_method_description' );
     27    return apply_filters( 'wpml_translate_single_string', $description, 'admin_texts_woocommerce_shipping', 'shipping_method_' . $method->instance_id . '_description' );
    2828}
  • wc-shipping-method-description/trunk/readme.txt

    r2713246 r2728045  
    33Tags: woocommerce, shipping, description
    44Requires at least: 4.0
    5 Tested up to: 5.8
     5Tested up to: 6.0
    66Requires PHP: 5.3
    7 Stable tag: 1.2.4
     7Stable tag: 1.2.5
    88License: GPLv3 or later License
    99WC requires at least: 2.6
    10 WC tested up to: 5.5
     10WC tested up to: 6.4
    1111
    1212Add a description to all WooCommerce shipping methods on cart and checkout pages.
     
    2828== Changelog ==
    2929
     30= 1.2.5 =
     31* Tested up to WP 6.0, WC 6.4
     32* Fix: WPML description translation for each method instance
     33
     34= 1.2.4 =
     35* Fix: Check WC is activated before using WC function
     36
    3037= 1.2.3 =
    3138* Add CSS class to description HTML output
     
    3946= 1.2.0 =
    4047* Feature: allow HTML tags in description
    41 * Fix: wrong variable name when guessing field position
     48* Fix: Wrong variable name when guessing field position
    4249
    4350= 1.1.0 =
    4451* Added Table Rate Shipping compatibility
    45 * Fix: function redeclaration error with Polylang integration
     52* Fix: Function redeclaration error with Polylang integration
    4653
    4754= 1.0.0 =
  • wc-shipping-method-description/trunk/shipping-method-description-for-woocommerce.php

    r2713244 r2728045  
    66 * Author: Thomas Charbit
    77 * Author URI: https://thomascharbit.fr
    8  * Version: 1.2.4
     8 * Version: 1.2.5
    99 * License: GPLv3 or later License
    1010 * Requires at least: 4.4
    11  * Tested up to: 5.8
     11 * Tested up to: 6.0
    1212 * WC requires at least: 2.6
    13  * WC tested up to: 5.5
     13 * WC tested up to: 6.4
    1414 */
    1515
Note: See TracChangeset for help on using the changeset viewer.