slug = 'vendocrat_payment_methods'; $this->name = __( 'Payment Methods', 'woocommerce-payment-methods' ); $this->desc = __( 'Easily display your accepted payment methods', 'woocommerce-payment-methods' ); $this->title = __( 'Accepted Payment Methods', 'woocommerce-payment-methods' ); parent::__construct( $this->slug, 'vendocrat: '. $this->name, array( 'description' => $this->desc, ) ); } /** * Front-end display of widget * * @param array $args Widget arguments. * @param array $instance Saved values from database. * @return void * * @since 2014-09-08 * @version 2014-09-15 **************************************************/ public function widget( $args, $instance ) { $title = apply_filters( 'widget_title', $instance['title'] ); $methods = $instance['methods']; $style = $instance['style']; $tooltip = ($instance['tooltip'] != 'true') ? false : true; $placement = $instance['placement']; $xclass = $instance['xclass']; extract($args); echo $before_widget; if ( $title ) { echo $before_title . $title . $after_title; } global $vendocrat_wc_payment_methods; $atts = array( 'methods' => $methods, 'style' => $style, 'tooltip' => $tooltip, 'placement' => $placement, 'xclass' => $xclass, ); echo $vendocrat_wc_payment_methods->get_payment_methods( $atts ); echo $after_widget; } /** * Back-end widget form * * @param array $instance Previously saved values from database. * * @since 2014-09-08 * @version 2014-09-15 **************************************************/ public function form( $instance ) { $defaults = array( 'title' => $this->title, 'methods' => '', 'style' => 'default', 'tooltip' => 'false', 'placement' => 'bottom', 'xclass' => '', ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>

'. __( 'Optional', 'woocommerce-payment-methods' ) . ': ' . sprintf( __( 'Specify payment methods to be shown manually by entering their slugs comma separated (eg. "paypal,visa,mastercard" for PayPal, Visa and MasterCard). See %s for available payment methods an their slugs! If left blank the widget will try to automatically fetch available payment methods from WooCommerce.', 'woocommerce-payment-methods' ), 'PaymentFont.io' ); ?>