Plugin Directory

Changeset 3178124


Ignore:
Timestamp:
10/29/2024 02:49:55 PM (17 months ago)
Author:
dreamfox
Message:

Version 3.5.5

Location:
woocommerce-product-payments
Files:
302 added
2 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-product-payments/trunk/readme.txt

    r3171989 r3178124  
    55Requires PHP: 7.4
    66Tested up to: 6.6.1
    7 Stable tag: 3.5.4
     7Stable tag: 3.5.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7373
    7474== Changelog ==
     75= 3.5.5 =
     76* Bugfixes
     77* tested with latest woocommerce
     78* tested with latest wordpress
    7579
    7680= 3.5.4 =
  • woocommerce-product-payments/trunk/woocommerce-product-payments.php

    r3171989 r3178124  
    55* Plugin URI: https://www.dreamfoxmedia.com/project/woocommerce-payment-gateway-per-product-premium/
    66* Description: Extend WooCommerce plugin to add different payments methods to a product
    7 * Version: 3.5.4
     7* Version: 3.5.5
    88 * WC tested up to: 7.8
    99 * WC tested up to: 9.2.3
     
    267267            return $post_id;
    268268        }
    269         if ( get_post_type() === 'product' && isset( $_POST['pays'] ) ) {
     269        if ( get_post_type() === 'product' ) {
    270270            delete_post_meta( $post_id, DFM_PGPPFW_PAYMENT_META_KEY );
    271271            $productIds = get_option( 'woocommerce_product_apply', array() );
     
    275275            }
    276276            $payments = array();
    277             $post_payments = array_filter( array_map( 'sanitize_title', $_POST['pays'] ) );
     277            if ( isset( $_POST['pays'] ) ) {
     278                $post_payments = array_filter( array_map( 'sanitize_title', $_POST['pays'] ) );
     279            } else {
     280                $post_payments = [];
     281            }
    278282            if ( $post_payments ) {
    279283                foreach ( $post_payments as $pay ) {
     
    281285                }
    282286            }
    283             update_post_meta( $post_id, DFM_PGPPFW_PAYMENT_META_KEY, $payments );
     287            if ( count( $payments ) ) {
     288                update_post_meta( $post_id, DFM_PGPPFW_PAYMENT_META_KEY, $payments );
     289            } else {
     290                delete_post_meta( $post_id, DFM_PGPPFW_PAYMENT_META_KEY );
     291            }
    284292        }
    285293    }
Note: See TracChangeset for help on using the changeset viewer.