Changeset 1751992
- Timestamp:
- 10/24/2017 05:13:51 PM (8 years ago)
- Location:
- custom-availability-for-woocommerce
- Files:
-
- 8 added
- 4 edited
- 1 copied
-
tags/1.0.1 (copied) (copied from custom-availability-for-woocommerce/trunk)
-
tags/1.0.1/includes (added)
-
tags/1.0.1/includes/class-woocommerce-custom-availability-list-table.php (added)
-
tags/1.0.1/includes/class-woocommerce-custom-availability-page.php (added)
-
tags/1.0.1/includes/index.php (added)
-
tags/1.0.1/readme.txt (modified) (1 diff)
-
tags/1.0.1/woocommerce-custom-availability.php (modified) (6 diffs)
-
trunk/includes (added)
-
trunk/includes/class-woocommerce-custom-availability-list-table.php (added)
-
trunk/includes/class-woocommerce-custom-availability-page.php (added)
-
trunk/includes/index.php (added)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/woocommerce-custom-availability.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-availability-for-woocommerce/tags/1.0.1/readme.txt
r1751984 r1751992 5 5 Requires at least: 4.3.1 6 6 Tested up to: 4.7.1 7 Stable tag: 1. 0.17 Stable tag: 1.1.0 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html -
custom-availability-for-woocommerce/tags/1.0.1/woocommerce-custom-availability.php
r1751984 r1751992 4 4 * Plugin URI: https://github.com/anttiviljami/woocommerce-custom-availability 5 5 * Description: Set custom availability for products 6 * Version: 1. 0.16 * Version: 1.1.0 7 7 * Author: @anttiviljami 8 8 * Author: https://github.com/anttiviljami 9 9 * License: GPLv3 10 10 * Text Domain: woocommerce-custom-availability 11 * Tested up to: 4.8 11 12 */ 12 13 … … 24 25 */ 25 26 27 28 if ( ! defined( 'ABSPATH' ) ) { 29 exit; // Exit if accessed directly. 30 } 31 26 32 if ( ! class_exists( 'WooCommerce_Custom_Availability' ) ) : 27 33 … … 37 43 38 44 private function __construct() { 45 46 $this->includes(); 47 39 48 // load textdomain for translations 40 49 add_action( 'plugins_loaded', array( $this, 'load_our_textdomain' ) ); … … 54 63 // use custom availability in the frontend 55 64 add_filter( 'woocommerce_get_availability', array( $this, 'custom_availability' ), 10, 2 ); 65 } 66 67 /** 68 * Include required core files used in admin 69 */ 70 public function includes() { 71 require_once plugin_dir_path( __FILE__ ) . 'includes/class-woocommerce-custom-availability-list-table.php'; 72 require_once plugin_dir_path( __FILE__ ) . 'includes/class-woocommerce-custom-availability-page.php'; 56 73 } 57 74 … … 98 115 } 99 116 100 if ( ! isset( $_REQUEST['_custom_availability_simple'] ) || empty( $_REQUEST['_custom_availability_simple'] ) ) { 101 update_post_meta( $post->ID, '_custom_availability', '' ); 102 } else { 103 update_post_meta( $post->ID, '_custom_availability', $_REQUEST['_custom_availability_simple'] ); 104 } 117 $_custom_availability_simple = ( isset( $_POST['_custom_availability_simple'] ) && ! empty( $_POST['_custom_availability_simple'] ) ) ? sanitize_text_field( $_POST['_custom_availability_simple'] ) : ''; 118 update_post_meta( $post->ID, '_custom_availability', $_custom_availability_simple ); 105 119 } 106 120 … … 132 146 */ 133 147 public function save_custom_availability_variation_field( $post_id ) { 134 if ( ! isset( $_REQUEST['_custom_availability'][ $post_id ] ) || empty( $_REQUEST['_custom_availability'][ $post_id ] ) ) { 135 update_post_meta( $post_id, '_custom_availability', '' ); 136 } else { 137 update_post_meta( $post_id, '_custom_availability', esc_attr( $_REQUEST['_custom_availability'][ $post_id ] ) ); 138 } 148 $_custom_availability = ( isset( $_POST['_custom_availability'][ $post_id ] ) && ! empty( $_POST['_custom_availability'][ $post_id ] ) ) ? sanitize_text_field( $_POST['_custom_availability'][ $post_id ] ) : ''; 149 update_post_meta( $post_id, '_custom_availability', $_custom_availability ); 139 150 } 140 151 -
custom-availability-for-woocommerce/trunk/readme.txt
r1751984 r1751992 5 5 Requires at least: 4.3.1 6 6 Tested up to: 4.7.1 7 Stable tag: 1. 0.17 Stable tag: 1.1.0 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html -
custom-availability-for-woocommerce/trunk/woocommerce-custom-availability.php
r1751984 r1751992 4 4 * Plugin URI: https://github.com/anttiviljami/woocommerce-custom-availability 5 5 * Description: Set custom availability for products 6 * Version: 1. 0.16 * Version: 1.1.0 7 7 * Author: @anttiviljami 8 8 * Author: https://github.com/anttiviljami 9 9 * License: GPLv3 10 10 * Text Domain: woocommerce-custom-availability 11 * Tested up to: 4.8 11 12 */ 12 13 … … 24 25 */ 25 26 27 28 if ( ! defined( 'ABSPATH' ) ) { 29 exit; // Exit if accessed directly. 30 } 31 26 32 if ( ! class_exists( 'WooCommerce_Custom_Availability' ) ) : 27 33 … … 37 43 38 44 private function __construct() { 45 46 $this->includes(); 47 39 48 // load textdomain for translations 40 49 add_action( 'plugins_loaded', array( $this, 'load_our_textdomain' ) ); … … 54 63 // use custom availability in the frontend 55 64 add_filter( 'woocommerce_get_availability', array( $this, 'custom_availability' ), 10, 2 ); 65 } 66 67 /** 68 * Include required core files used in admin 69 */ 70 public function includes() { 71 require_once plugin_dir_path( __FILE__ ) . 'includes/class-woocommerce-custom-availability-list-table.php'; 72 require_once plugin_dir_path( __FILE__ ) . 'includes/class-woocommerce-custom-availability-page.php'; 56 73 } 57 74 … … 98 115 } 99 116 100 if ( ! isset( $_REQUEST['_custom_availability_simple'] ) || empty( $_REQUEST['_custom_availability_simple'] ) ) { 101 update_post_meta( $post->ID, '_custom_availability', '' ); 102 } else { 103 update_post_meta( $post->ID, '_custom_availability', $_REQUEST['_custom_availability_simple'] ); 104 } 117 $_custom_availability_simple = ( isset( $_POST['_custom_availability_simple'] ) && ! empty( $_POST['_custom_availability_simple'] ) ) ? sanitize_text_field( $_POST['_custom_availability_simple'] ) : ''; 118 update_post_meta( $post->ID, '_custom_availability', $_custom_availability_simple ); 105 119 } 106 120 … … 132 146 */ 133 147 public function save_custom_availability_variation_field( $post_id ) { 134 if ( ! isset( $_REQUEST['_custom_availability'][ $post_id ] ) || empty( $_REQUEST['_custom_availability'][ $post_id ] ) ) { 135 update_post_meta( $post_id, '_custom_availability', '' ); 136 } else { 137 update_post_meta( $post_id, '_custom_availability', esc_attr( $_REQUEST['_custom_availability'][ $post_id ] ) ); 138 } 148 $_custom_availability = ( isset( $_POST['_custom_availability'][ $post_id ] ) && ! empty( $_POST['_custom_availability'][ $post_id ] ) ) ? sanitize_text_field( $_POST['_custom_availability'][ $post_id ] ) : ''; 149 update_post_meta( $post_id, '_custom_availability', $_custom_availability ); 139 150 } 140 151
Note: See TracChangeset
for help on using the changeset viewer.