Plugin Directory

Changeset 2633227


Ignore:
Timestamp:
11/21/2021 10:55:06 PM (4 years ago)
Author:
thomascharbit
Message:

1.1.0 release

Location:
wc-shipping-method-description
Files:
2 edited
5 copied

Legend:

Unmodified
Added
Removed
  • wc-shipping-method-description/tags/1.1.0/readme.txt

    r2584056 r2633227  
    2828== Changelog ==
    2929
     30= 1.1.0 =
     31* Added Table Rate Shipping compatibility
     32* Fix: function redeclaration error with Polylang integration
     33
    3034= 1.0.0 =
    3135* Initial release
  • wc-shipping-method-description/tags/1.1.0/shipping-method-description-for-woocommerce.php

    r2584018 r2633227  
    66 * Author: Thomas Charbit
    77 * Author URI: https://thomascharbit.fr
    8  * Version: 1.0.0
     8 * Version: 1.1.0
    99 * License: GPLv3 or later License
    1010 * Requires at least: 4.4
     
    2828
    2929/**
    30  * Add Polylang/WPML integration if needed
     30 * Init plugin
    3131 **/
    3232add_action( 'init', 'smdfw_init', 100 );
    3333function smdfw_init() {
     34    // Add Polylang integration if needed
    3435    if ( function_exists( 'pll_current_language' ) ) {
    3536        require_once SMDFW_DIR . 'includes/smdfw-polylang.php';
    3637    }
     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    }
    3742
    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' );
    4047    }
    4148}
     
    5158        $message = '<div class="error"><p>' . $error . '</p></div>';
    5259        echo $message;
    53     }
    54 }
    55 
    56 /**
    57  * Init plugin
    58  */
    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' );
    6560    }
    6661}
  • wc-shipping-method-description/trunk/readme.txt

    r2584056 r2633227  
    2828== Changelog ==
    2929
     30= 1.1.0 =
     31* Added Table Rate Shipping compatibility
     32* Fix: function redeclaration error with Polylang integration
     33
    3034= 1.0.0 =
    3135* Initial release
  • wc-shipping-method-description/trunk/shipping-method-description-for-woocommerce.php

    r2584018 r2633227  
    66 * Author: Thomas Charbit
    77 * Author URI: https://thomascharbit.fr
    8  * Version: 1.0.0
     8 * Version: 1.1.0
    99 * License: GPLv3 or later License
    1010 * Requires at least: 4.4
     
    2828
    2929/**
    30  * Add Polylang/WPML integration if needed
     30 * Init plugin
    3131 **/
    3232add_action( 'init', 'smdfw_init', 100 );
    3333function smdfw_init() {
     34    // Add Polylang integration if needed
    3435    if ( function_exists( 'pll_current_language' ) ) {
    3536        require_once SMDFW_DIR . 'includes/smdfw-polylang.php';
    3637    }
     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    }
    3742
    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' );
    4047    }
    4148}
     
    5158        $message = '<div class="error"><p>' . $error . '</p></div>';
    5259        echo $message;
    53     }
    54 }
    55 
    56 /**
    57  * Init plugin
    58  */
    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' );
    6560    }
    6661}
Note: See TracChangeset for help on using the changeset viewer.