Plugin Directory

Changeset 1258200


Ignore:
Timestamp:
10/02/2015 12:18:15 PM (10 years ago)
Author:
siteoptimo
Message:

Version 1.4.2.

Location:
woocommerce-hear-about-us
Files:
2 added
2 deleted
10 edited
20 copied

Legend:

Unmodified
Added
Removed
  • woocommerce-hear-about-us/tags/1.4.2/i18n/languages/woocommerce-hear-about-us-nl_NL.po

    r1242188 r1258200  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WooCommerce Hear About Us 1.4.1\n"
     5"Project-Id-Version: WooCommerce Hear About Us 1.4.2\n"
    66"Report-Msgid-Bugs-To: https://github.com/siteoptimo/woocommerce-hear-about-us/issues\n"
    77"POT-Creation-Date: 2015-09-09 12:22:59+00:00\n"
  • woocommerce-hear-about-us/tags/1.4.2/i18n/languages/woocommerce-hear-about-us.pot

    r1242188 r1258200  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WooCommerce Hear About Us 1.4.1\n"
     5"Project-Id-Version: WooCommerce Hear About Us 1.4.2\n"
    66"Report-Msgid-Bugs-To: https://github.com/siteoptimo/woocommerce-hear-about-us/issues\n"
    77"POT-Creation-Date: 2015-09-09 12:22:59+00:00\n"
  • woocommerce-hear-about-us/tags/1.4.2/includes/admin/wchau-admin-display-on-order.php

    r1116079 r1258200  
    1818
    1919    function display_source_with_order_meta( $order ) {
    20         $options = WCHAU_Custom_Field::get_options();
    21         $order_source = get_post_meta( $order->id, 'source', true );
    22         if ( $order_source == '' ) {
    23             $order_source = __( 'N/A', 'woocommerce-hear-about-us' );
    24         }
    25 
    26         if(isset($options[$order_source])) {
    27             $order_source = $options[$order_source];
    28         }
     20        $order_source = wchau_get_option_value(get_post_meta( $order->id, 'source', true ));
    2921
    3022        echo '<p><strong>' . __( 'Source', 'woocommerce-hear-about-us' ) . ':</strong> ' . $order_source . '</p>';
    31 
    3223    }
    3324
  • woocommerce-hear-about-us/tags/1.4.2/includes/wchau-custom-field.php

    r1242188 r1258200  
    7474        if ( ! empty( $_POST['wchau_source'] ) ) {
    7575
    76             $options = $this->get_options();
    7776            $source = $_POST['wchau_source'];
    7877
    79             $source = sanitize_text_field( isset( $options[ $source ] ) ? $options[ $source ] : $source );
     78            $source = sanitize_text_field( wchau_get_option_value( $source ) );
    8079
    8180            update_user_meta( $user_id, '_wchau_source', $source );
     
    8584    function save_source_to_order_meta( $order_id ) {
    8685        if ( ! empty( $_POST['wchau_source'] ) ) {
    87             update_post_meta( $order_id, 'source', sanitize_text_field( $_POST['wchau_source'] ) );
     86            update_post_meta( $order_id, 'source', wchau_get_option_value( sanitize_text_field( $_POST['wchau_source'] ) ) );
    8887        }
    8988    }
  • woocommerce-hear-about-us/tags/1.4.2/includes/wchau-functions.php

    r1000516 r1258200  
    2525    return $filtered;
    2626}
     27
     28function wchau_get_option_value($option, $empty_value = null) {
     29    $options = WCHAU_Custom_Field::get_options();
     30    if ( empty( $option ) ) {
     31        return !isset($empty_value) ? __( 'N/A', 'woocommerce-hear-about-us' ) : $empty_value;
     32    }
     33
     34    // for compatibility reasons.
     35    if(isset($options[$option])) {
     36        return $options[$option];
     37    }
     38
     39    return $option;
     40}
  • woocommerce-hear-about-us/tags/1.4.2/readme.txt

    r1242188 r1258200  
    77Requires at least: WordPress 3.8 and WooCommerce 2.1
    88Tested up to: 4.4
    9 Stable tag: 1.4.1
     9Stable tag: 1.4.2
    1010
    1111Ask where your new customers come from at checkout.
     
    5151
    5252== Changelog ==
     53= 1.4.2 =
     54* Added custom sortable column to order listing.
     55* Added custom sortable column to user listing. Thanks for your input, [goto10](https://profiles.wordpress.org/goto10/).
     56
    5357= 1.4.1 =
    5458* Fixed a bug where "other" field was not displayed on the user profile.
  • woocommerce-hear-about-us/tags/1.4.2/woocommerce-hear-about-us.php

    r1242188 r1258200  
    22/*
    33Plugin Name: WooCommerce Hear About Us
    4 Version: 1.4.1
     4Version: 1.4.2
    55Plugin URI: http://www.siteoptimo.com/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wch
    66Description: Ask where your new customers come from at checkout.
     
    4141         *
    4242         * @class WooCommerce_HearAboutUs
    43          * @version 1.4.1
     43         * @version 1.4.2
    4444         */
    4545        final class WooCommerce_HearAboutUs {
     
    5454             * @var string
    5555             */
    56             public static $version = "1.4.1";
     56            public static $version = "1.4.2";
    5757
    5858            /**
     
    198198                new WCHAU_Admin_Setting_Fields();
    199199                new WCHAU_Admin_Display_On_Order();
     200                new WCHAU_Admin_Column();
    200201
    201202            }
  • woocommerce-hear-about-us/trunk/i18n/languages/woocommerce-hear-about-us-nl_NL.po

    r1242188 r1258200  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WooCommerce Hear About Us 1.4.1\n"
     5"Project-Id-Version: WooCommerce Hear About Us 1.4.2\n"
    66"Report-Msgid-Bugs-To: https://github.com/siteoptimo/woocommerce-hear-about-us/issues\n"
    77"POT-Creation-Date: 2015-09-09 12:22:59+00:00\n"
  • woocommerce-hear-about-us/trunk/i18n/languages/woocommerce-hear-about-us.pot

    r1242188 r1258200  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WooCommerce Hear About Us 1.4.1\n"
     5"Project-Id-Version: WooCommerce Hear About Us 1.4.2\n"
    66"Report-Msgid-Bugs-To: https://github.com/siteoptimo/woocommerce-hear-about-us/issues\n"
    77"POT-Creation-Date: 2015-09-09 12:22:59+00:00\n"
  • woocommerce-hear-about-us/trunk/includes/admin/wchau-admin-display-on-order.php

    r1116079 r1258200  
    1818
    1919    function display_source_with_order_meta( $order ) {
    20         $options = WCHAU_Custom_Field::get_options();
    21         $order_source = get_post_meta( $order->id, 'source', true );
    22         if ( $order_source == '' ) {
    23             $order_source = __( 'N/A', 'woocommerce-hear-about-us' );
    24         }
    25 
    26         if(isset($options[$order_source])) {
    27             $order_source = $options[$order_source];
    28         }
     20        $order_source = wchau_get_option_value(get_post_meta( $order->id, 'source', true ));
    2921
    3022        echo '<p><strong>' . __( 'Source', 'woocommerce-hear-about-us' ) . ':</strong> ' . $order_source . '</p>';
    31 
    3223    }
    3324
  • woocommerce-hear-about-us/trunk/includes/wchau-custom-field.php

    r1242188 r1258200  
    7474        if ( ! empty( $_POST['wchau_source'] ) ) {
    7575
    76             $options = $this->get_options();
    7776            $source = $_POST['wchau_source'];
    7877
    79             $source = sanitize_text_field( isset( $options[ $source ] ) ? $options[ $source ] : $source );
     78            $source = sanitize_text_field( wchau_get_option_value( $source ) );
    8079
    8180            update_user_meta( $user_id, '_wchau_source', $source );
     
    8584    function save_source_to_order_meta( $order_id ) {
    8685        if ( ! empty( $_POST['wchau_source'] ) ) {
    87             update_post_meta( $order_id, 'source', sanitize_text_field( $_POST['wchau_source'] ) );
     86            update_post_meta( $order_id, 'source', wchau_get_option_value( sanitize_text_field( $_POST['wchau_source'] ) ) );
    8887        }
    8988    }
  • woocommerce-hear-about-us/trunk/includes/wchau-functions.php

    r1000516 r1258200  
    2525    return $filtered;
    2626}
     27
     28function wchau_get_option_value($option, $empty_value = null) {
     29    $options = WCHAU_Custom_Field::get_options();
     30    if ( empty( $option ) ) {
     31        return !isset($empty_value) ? __( 'N/A', 'woocommerce-hear-about-us' ) : $empty_value;
     32    }
     33
     34    // for compatibility reasons.
     35    if(isset($options[$option])) {
     36        return $options[$option];
     37    }
     38
     39    return $option;
     40}
  • woocommerce-hear-about-us/trunk/readme.txt

    r1242188 r1258200  
    77Requires at least: WordPress 3.8 and WooCommerce 2.1
    88Tested up to: 4.4
    9 Stable tag: 1.4.1
     9Stable tag: 1.4.2
    1010
    1111Ask where your new customers come from at checkout.
     
    5151
    5252== Changelog ==
     53= 1.4.2 =
     54* Added custom sortable column to order listing.
     55* Added custom sortable column to user listing. Thanks for your input, [goto10](https://profiles.wordpress.org/goto10/).
     56
    5357= 1.4.1 =
    5458* Fixed a bug where "other" field was not displayed on the user profile.
  • woocommerce-hear-about-us/trunk/woocommerce-hear-about-us.php

    r1242188 r1258200  
    22/*
    33Plugin Name: WooCommerce Hear About Us
    4 Version: 1.4.1
     4Version: 1.4.2
    55Plugin URI: http://www.siteoptimo.com/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wch
    66Description: Ask where your new customers come from at checkout.
     
    4141         *
    4242         * @class WooCommerce_HearAboutUs
    43          * @version 1.4.1
     43         * @version 1.4.2
    4444         */
    4545        final class WooCommerce_HearAboutUs {
     
    5454             * @var string
    5555             */
    56             public static $version = "1.4.1";
     56            public static $version = "1.4.2";
    5757
    5858            /**
     
    198198                new WCHAU_Admin_Setting_Fields();
    199199                new WCHAU_Admin_Display_On_Order();
     200                new WCHAU_Admin_Column();
    200201
    201202            }
Note: See TracChangeset for help on using the changeset viewer.