wcap_add_coupon_selector_options

The WordPress Core wcap add coupon selector options class.

Defined (1)

The class is defined in the following location(s).

/includes/admin/wcap_add_coupon_selecter_options.php  
  1. class wcap_add_coupon_selector_options { 
  2.  
  3. public function __construct() { 
  4. add_action('woocommerce_coupon_options', array($this, 'wcap_coupon_selector_options')); 
  5. add_action('woocommerce_coupon_options_save', array($this, 'wcap_coupon_selector_options_save')); 
  6.  
  7.  
  8. public function wcap_coupon_selector_options() { 
  9. //exclude coupon from coupon selector 
  10. woocommerce_wp_checkbox( array( 'id' => 'exclude_in_coupon_selector', 'label' => __( 'Exclude in Coupon Selector', 'wcap' ), 'description' => sprintf(__( 'Check this box if you do not want to show this coupon in coupon selector coupons list.', 'wcap' )) ) ); 
  11.  
  12. public function wcap_coupon_selector_options_save($post_id) { 
  13. $exclude_in_coupon_selector = isset( $_POST['exclude_in_coupon_selector'] ) ? 'yes' : 'no'; 
  14. update_post_meta( $post_id, 'exclude_in_coupon_selector', $exclude_in_coupon_selector );