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
- class Accepted_Payment_Methods extends WP_Widget {
- function Accepted_Payment_Methods() {
- // Instantiate the parent object
- parent::__construct( false, 'WooCommerce Accepted Payment Methods' );
- }
- function widget( $args, $instance ) {
- // Widget output
- extract( $args );
- $title = apply_filters( 'widget_title', $instance['title'] );
- echo $before_widget;
- if ( ! empty( $title ) )
- echo $before_title . $title . $after_title;
- wc_accepted_payment_methods();
- echo $after_widget;
- }
- /**
- * Sanitize widget form values as they are saved.
- */
- public function update( $new_instance, $old_instance ) {
- $instance = array();
- $instance['title'] = strip_tags( $new_instance['title'] );
- return $instance;
- }
- /**
- * Back-end widget form.
- */
- public function form( $instance ) {
- if ( isset( $instance[ 'title' ] ) ) {
- $title = $instance[ 'title' ];
- }
- else {
- $title = __( 'Accepted Payment Methods', 'woocommerce-accepted-payment-methods' );
- }
- ?>
- <p>
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'woocommerce-accepted-payment-methods' ); ?></label>
- <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 ); ?>" />
- </p>
- <p>
- <?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>.
- </p>
- <?php
- }
- }