Changeset 2703760
- Timestamp:
- 04/02/2022 06:25:30 PM (4 years ago)
- Location:
- woominecraft
- Files:
-
- 6 edited
- 1 copied
-
tags/1.4.2 (copied) (copied from woominecraft/trunk)
-
tags/1.4.2/includes/order-manager.php (modified) (3 diffs)
-
tags/1.4.2/readme.txt (modified) (2 diffs)
-
tags/1.4.2/woominecraft.php (modified) (2 diffs)
-
trunk/includes/order-manager.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/woominecraft.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woominecraft/tags/1.4.2/includes/order-manager.php
r2669487 r2703760 3 3 namespace WooMinecraft\Orders\Manager; 4 4 5 use function WooMinecraft\Helpers\wmc_items_have_commands;6 5 use function WooMinecraft\Orders\Cache\bust_command_cache; 7 6 … … 17 16 add_action( 'woocommerce_before_checkout_billing_form', $n( 'additional_checkout_field' ) ); 18 17 add_action( 'woocommerce_thankyou', $n( 'thanks' ) ); 19 add_action( 'woocommerce_checkout_process', $n( 'require_fields' ) );20 }21 22 /**23 * Makes sure some fields are set up properly.24 */25 function require_fields() {26 global $woocommerce;27 28 if ( ! $woocommerce instanceof \WooCommerce ) {29 return;30 }31 32 $items = $woocommerce->cart->cart_contents;33 if ( ! wmc_items_have_commands( $items ) ) {34 return;35 }36 37 $player_id = isset( $_POST['player_id'] ) ? sanitize_text_field( $_POST['player_id'] ) : false; // @codingStandardsIgnoreLine No nonce needed.38 if ( ! $player_id ) {39 wc_add_notice( __( 'You MUST provide a Minecraft username.', 'woominecraft' ), 'error' );40 return;41 }42 18 } 43 19 … … 107 83 function additional_checkout_field( $cart ) { 108 84 $items = WC()->cart->cart_contents; 109 if ( ! wmc_items_have_commands( $items ) || ! function_exists( 'woocommerce_form_field' ) ) {85 if ( ! \WooMinecraft\Helpers\wmc_items_have_commands( $items ) || ! function_exists( 'woocommerce_form_field' ) ) { 110 86 return false; 111 87 } -
woominecraft/tags/1.4.2/readme.txt
r2669487 r2703760 4 4 Requires at least: 4.4.2 5 5 Tested up to: 5.8.2 6 Stable tag: 1.4. 36 Stable tag: 1.4.2 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 55 55 56 56 == Changelog == 57 58 = 1.4.3 =59 * Deployment changes ( dev-related )60 * Adds a check in the checkout sequence for when suer leaves Player field blank.61 57 62 58 = 1.4.1 = -
woominecraft/tags/1.4.2/woominecraft.php
r2669487 r2703760 5 5 Description: A WooCommerce plugin which allows donations and commands to be sent to your Minecraft server. 6 6 Author: Jerry Wood 7 Version: 1.4. 37 Version: 1.4.2 8 8 License: GPLv2 9 9 Text Domain: woominecraft … … 18 18 define( 'WMC_INCLUDES', plugin_dir_path( __FILE__ ) . 'includes/' ); 19 19 define( 'WMC_URL', plugin_dir_url( __FILE__ ) ); 20 define( 'WMC_VERSION', '1.4. 3' );20 define( 'WMC_VERSION', '1.4.2' ); 21 21 22 22 // Require the helpers file, for use in :allthethings: -
woominecraft/trunk/includes/order-manager.php
r2669487 r2703760 3 3 namespace WooMinecraft\Orders\Manager; 4 4 5 use function WooMinecraft\Helpers\wmc_items_have_commands;6 5 use function WooMinecraft\Orders\Cache\bust_command_cache; 7 6 … … 17 16 add_action( 'woocommerce_before_checkout_billing_form', $n( 'additional_checkout_field' ) ); 18 17 add_action( 'woocommerce_thankyou', $n( 'thanks' ) ); 19 add_action( 'woocommerce_checkout_process', $n( 'require_fields' ) );20 }21 22 /**23 * Makes sure some fields are set up properly.24 */25 function require_fields() {26 global $woocommerce;27 28 if ( ! $woocommerce instanceof \WooCommerce ) {29 return;30 }31 32 $items = $woocommerce->cart->cart_contents;33 if ( ! wmc_items_have_commands( $items ) ) {34 return;35 }36 37 $player_id = isset( $_POST['player_id'] ) ? sanitize_text_field( $_POST['player_id'] ) : false; // @codingStandardsIgnoreLine No nonce needed.38 if ( ! $player_id ) {39 wc_add_notice( __( 'You MUST provide a Minecraft username.', 'woominecraft' ), 'error' );40 return;41 }42 18 } 43 19 … … 107 83 function additional_checkout_field( $cart ) { 108 84 $items = WC()->cart->cart_contents; 109 if ( ! wmc_items_have_commands( $items ) || ! function_exists( 'woocommerce_form_field' ) ) {85 if ( ! \WooMinecraft\Helpers\wmc_items_have_commands( $items ) || ! function_exists( 'woocommerce_form_field' ) ) { 110 86 return false; 111 87 } -
woominecraft/trunk/readme.txt
r2669487 r2703760 4 4 Requires at least: 4.4.2 5 5 Tested up to: 5.8.2 6 Stable tag: 1.4. 36 Stable tag: 1.4.2 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 55 55 56 56 == Changelog == 57 58 = 1.4.3 =59 * Deployment changes ( dev-related )60 * Adds a check in the checkout sequence for when suer leaves Player field blank.61 57 62 58 = 1.4.1 = -
woominecraft/trunk/woominecraft.php
r2669487 r2703760 5 5 Description: A WooCommerce plugin which allows donations and commands to be sent to your Minecraft server. 6 6 Author: Jerry Wood 7 Version: 1.4. 37 Version: 1.4.2 8 8 License: GPLv2 9 9 Text Domain: woominecraft … … 18 18 define( 'WMC_INCLUDES', plugin_dir_path( __FILE__ ) . 'includes/' ); 19 19 define( 'WMC_URL', plugin_dir_url( __FILE__ ) ); 20 define( 'WMC_VERSION', '1.4. 3' );20 define( 'WMC_VERSION', '1.4.2' ); 21 21 22 22 // Require the helpers file, for use in :allthethings:
Note: See TracChangeset
for help on using the changeset viewer.