Accepted_Payment_Methods

The WooCommerce Accepted Payment Methods Accepted Payment Methods class.

Defined (1)

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

/accepted-payment-methods.php  
  1. class Accepted_Payment_Methods extends WP_Widget { 
  2.  
  3. function Accepted_Payment_Methods() { 
  4. // Instantiate the parent object 
  5. parent::__construct( false, 'WooCommerce Accepted Payment Methods' ); 
  6.  
  7. function widget( $args, $instance ) { 
  8. // Widget output 
  9. extract( $args ); 
  10.  
  11. $title = apply_filters( 'widget_title', $instance['title'] ); 
  12.  
  13. echo $before_widget; 
  14. if ( ! empty( $title ) ) 
  15. echo $before_title . $title . $after_title; 
  16. wc_accepted_payment_methods(); 
  17. echo $after_widget; 
  18. /** 
  19. * Sanitize widget form values as they are saved. 
  20. */ 
  21. public function update( $new_instance, $old_instance ) { 
  22. $instance = array(); 
  23. $instance['title'] = strip_tags( $new_instance['title'] ); 
  24.  
  25. return $instance; 
  26.  
  27. /** 
  28. * Back-end widget form. 
  29. */ 
  30. public function form( $instance ) { 
  31. if ( isset( $instance[ 'title' ] ) ) { 
  32. $title = $instance[ 'title' ]; 
  33. else { 
  34. $title = __( 'Accepted Payment Methods', 'woocommerce-accepted-payment-methods' ); 
  35. ?> 
  36. <p> 
  37. <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'woocommerce-accepted-payment-methods' ); ?></label> 
  38. <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /> 
  39. </p> 
  40. <p> 
  41. <?php _e( 'Configure which payment methods your store accepts in the', 'woocommerce-accepted-payment-methods' ); ?> <a href="<?php echo admin_url( 'admin.php?page=woocommerce_settings&tab=catalog' ); ?>"><?php _e( 'WooCommerce settings', 'woocommerce-accepted-payment-methods' ); ?></a>. 
  42. </p> 
  43. <?php 
  44.