Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
Don't auto-enable the PayPal payment method (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinshreve authored Aug 7, 2017
1 parent 5ce4ed1 commit c35fe79
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
16 changes: 16 additions & 0 deletions hotfixes/wc-api-dev-paypal-defaults.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* Prevents the paypal payment method from being auto enabled if settings haven't been configured.
*
* @since 0.8.2
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

function wc_api_dev_paypal_defaults( $settings ) {
$settings['enabled']['default'] = 'no';
return $settings;
}
add_filter( 'woocommerce_settings_api_form_fields_paypal', 'wc_api_dev_paypal_defaults' );
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: automattic, woothemes
Tags: woocommerce, rest-api, api
Requires at least: 4.6
Tested up to: 4.8
Stable tag: 0.8.1
Stable tag: 0.8.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -25,6 +25,9 @@ This section describes how to install the plugin and get it working.

== Changelog ==

= 0.8.2 =
* Fix - Don't auto enable the PayPal payment method.

= 0.8.1 =
* Fix - Fix auto plugin update logic
* Fix - Don't auto enable the cheque payment method.
Expand Down
5 changes: 3 additions & 2 deletions wc-api-dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WooCommerce API Dev
* Plugin URI: https://woocommerce.com/
* Description: A feature plugin providing a bleeding edge version of the WooCommerce REST API.
* Version: 0.8.1
* Version: 0.8.2
* Author: Automattic
* Author URI: https://woocommerce.com
* Requires at least: 4.4
Expand Down Expand Up @@ -33,7 +33,7 @@ class WC_API_Dev {
/**
* Current version of the API plugin.
*/
const CURRENT_VERSION = '0.8.1';
const CURRENT_VERSION = '0.8.2';

/**
* Minimum version needed to run this version of the API.
Expand Down Expand Up @@ -132,6 +132,7 @@ public function includes() {
include_once( dirname( __FILE__ ) . '/hotfixes/wc-api-dev-jetpack-hotfixes.php' );
include_once( dirname( __FILE__ ) . '/hotfixes/wc-api-dev-email-site-title.php' );
include_once( dirname( __FILE__ ) . '/hotfixes/wc-api-dev-cheque-defaults.php' );
include_once( dirname( __FILE__ ) . '/hotfixes/wc-api-dev-paypal-defaults.php' );
}
}

Expand Down

0 comments on commit c35fe79

Please sign in to comment.