Update to 0.1.2

Fixed an error in widget class, added placement option to tooltips,
updated language files.
This commit is contained in:
Alexander
2014-09-15 03:19:28 +02:00
parent ac63a83931
commit a4e13eead1
11 changed files with 141 additions and 47 deletions
@@ -6,7 +6,7 @@
* @subpackage Payment Methods/Classes
*
* @since 2014-09-08
* @version 2014-09-08
* @version 2014-09-15
*
* @author Poellmann Alexander Manfred <alex@vendocr.at>
* @copyright Copyright 2014 vendocrat. All Rights Reserved.
@@ -51,16 +51,16 @@ class vendocrat_Widget_Payment_Methods extends WP_Widget {
* @return void
*
* @since 2014-09-08
* @version 2014-09-08
* @version 2014-09-15
**************************************************/
public function widget( $args, $instance ) {
$title = apply_filters( 'widget_title', $instance['title'] );
$tooltip = ($instance['tooltip'] != 'true') ? false : true;
$style = $instance['style'];
$xclass = $instance['xclass'];
$style = $instance['style'];
$tooltip = ($instance['tooltip'] != 'true') ? false : true;
$placement = $instance['placement'];
$xclass = $instance['xclass'];
echo $tooltip;
extract($args);
echo $before_widget;
@@ -87,7 +87,7 @@ class vendocrat_Widget_Payment_Methods extends WP_Widget {
* @param array $instance Previously saved values from database.
*
* @since 2014-09-08
* @version 2014-09-08
* @version 2014-09-15
**************************************************/
public function form( $instance ) {
$defaults = array(
@@ -117,6 +117,15 @@ class vendocrat_Widget_Payment_Methods extends WP_Widget {
<option value="true"<?php selected( $instance['tooltip'], 'true' ); ?>><?php _e( 'Yes', 'vendocrat-payment-methods' ); ?></option>
</select>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'placement' ); ?>"><?php _e( 'Placement', 'vendocrat-payment-methods' ); ?>:</label>
<select name="<?php echo $this->get_field_name( 'placement' ); ?>" class="widefat" id="<?php echo $this->get_field_id( 'placement' ); ?>">
<option value="top"<?php selected( $instance['placement'], 'top' ); ?>><?php _e( 'Top', 'vendocrat-payment-methods' ); ?></option>
<option value="right"<?php selected( $instance['placement'], 'right' ); ?>><?php _e( 'Right', 'vendocrat-payment-methods' ); ?></option>
<option value="bottom"<?php selected( $instance['placement'], 'bottom' ); ?>><?php _e( 'Bottom', 'vendocrat-payment-methods' ); ?></option>
<option value="left"<?php selected( $instance['placement'], 'left' ); ?>><?php _e( 'Left', 'vendocrat-payment-methods' ); ?></option>
</select>
</p>
<p>
<label for="<?php echo $this->get_field_id('xclass'); ?>"><?php _e( 'Extra classes', 'vendocrat-payment-methods' ); ?>:</label>
<input class="widefat" id="<?php echo $this->get_field_id('xclass'); ?>" name="<?php echo $this->get_field_name('xclass'); ?>" type="text" value="<?php echo esc_attr( $instance['xclass'] ); ?>" />
@@ -134,10 +143,11 @@ class vendocrat_Widget_Payment_Methods extends WP_Widget {
public function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['style'] = esc_attr( $new_instance['style'] );
$instance['tooltip'] = esc_attr( $new_instance['tooltip'] );
$instance['xclass'] = esc_attr( $new_instance['xclass'] );
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['style'] = esc_attr( $new_instance['style'] );
$instance['tooltip'] = esc_attr( $new_instance['tooltip'] );
$instance['placement'] = esc_attr( $new_instance['placement'] );
$instance['xclass'] = esc_attr( $new_instance['xclass'] );
return $instance;
}
Binary file not shown.
+27 -7
View File
@@ -1,10 +1,11 @@
msgid ""
msgstr ""
"Project-Id-Version: WooCommerce Payment Methods\n"
"POT-Creation-Date: 2014-09-08 01:40+0100\n"
"PO-Revision-Date: 2014-09-08 01:44+0100\n"
"POT-Creation-Date: 2014-09-15 03:06+0100\n"
"PO-Revision-Date: 2014-09-15 03:07+0100\n"
"Last-Translator: \n"
"Language-Team: vendocrat <hello@vendocr.at>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -12,7 +13,6 @@ msgstr ""
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-KeywordsList: __;_e\n"
"Language: de\n"
"X-Poedit-SearchPath-0: ..\n"
#: ../classes/class-widget-payment-methods.php:33
@@ -60,18 +60,38 @@ msgid "Yes"
msgstr "Ja"
#: ../classes/class-widget-payment-methods.php:121
msgid "Placement"
msgstr "Platzierung"
#: ../classes/class-widget-payment-methods.php:123
msgid "Top"
msgstr "Oben"
#: ../classes/class-widget-payment-methods.php:124
msgid "Right"
msgstr "Rechts"
#: ../classes/class-widget-payment-methods.php:125
msgid "Bottom"
msgstr "Unten"
#: ../classes/class-widget-payment-methods.php:126
msgid "Left"
msgstr "Links"
#: ../classes/class-widget-payment-methods.php:130
msgid "Extra classes"
msgstr "Zusätzliche Klassen"
#: ../payment-methods.php:220 ../payment-methods.php:260
#: ../payment-methods.php:266 ../payment-methods.php:271
#: ../payment-methods.php:221 ../payment-methods.php:261
#: ../payment-methods.php:267 ../payment-methods.php:272
msgid "Bank Transfer"
msgstr "Bank-Überweisung"
#: ../payment-methods.php:224
#: ../payment-methods.php:225
msgid "Pay with Cheque"
msgstr "Mit Scheck bezahlen"
#: ../payment-methods.php:292
#: ../payment-methods.php:293
msgid "Cash on Delivery"
msgstr "Nachname"
Binary file not shown.
+27 -7
View File
@@ -1,10 +1,11 @@
msgid ""
msgstr ""
"Project-Id-Version: WooCommerce Payment Methods\n"
"POT-Creation-Date: 2014-09-08 01:40+0100\n"
"PO-Revision-Date: 2014-09-08 01:44+0100\n"
"POT-Creation-Date: 2014-09-15 03:06+0100\n"
"PO-Revision-Date: 2014-09-15 03:07+0100\n"
"Last-Translator: \n"
"Language-Team: vendocrat <hello@vendocr.at>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -12,7 +13,6 @@ msgstr ""
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-KeywordsList: __;_e\n"
"Language: de\n"
"X-Poedit-SearchPath-0: ..\n"
#: ../classes/class-widget-payment-methods.php:33
@@ -60,18 +60,38 @@ msgid "Yes"
msgstr "Ja"
#: ../classes/class-widget-payment-methods.php:121
msgid "Placement"
msgstr "Platzierung"
#: ../classes/class-widget-payment-methods.php:123
msgid "Top"
msgstr "Oben"
#: ../classes/class-widget-payment-methods.php:124
msgid "Right"
msgstr "Rechts"
#: ../classes/class-widget-payment-methods.php:125
msgid "Bottom"
msgstr "Unten"
#: ../classes/class-widget-payment-methods.php:126
msgid "Left"
msgstr "Links"
#: ../classes/class-widget-payment-methods.php:130
msgid "Extra classes"
msgstr "Zusätzliche Klassen"
#: ../payment-methods.php:220 ../payment-methods.php:260
#: ../payment-methods.php:266 ../payment-methods.php:271
#: ../payment-methods.php:221 ../payment-methods.php:261
#: ../payment-methods.php:267 ../payment-methods.php:272
msgid "Bank Transfer"
msgstr "Bank-Überweisung"
#: ../payment-methods.php:224
#: ../payment-methods.php:225
msgid "Pay with Cheque"
msgstr "Mit Scheck bezahlen"
#: ../payment-methods.php:292
#: ../payment-methods.php:293
msgid "Cash on Delivery"
msgstr "Nachname"
Binary file not shown.
+27 -7
View File
@@ -1,10 +1,11 @@
msgid ""
msgstr ""
"Project-Id-Version: WooCommerce Payment Methods\n"
"POT-Creation-Date: 2014-09-08 01:40+0100\n"
"PO-Revision-Date: 2014-09-08 02:12+0100\n"
"POT-Creation-Date: 2014-09-15 03:08+0100\n"
"PO-Revision-Date: 2014-09-15 03:10+0100\n"
"Last-Translator: \n"
"Language-Team: vendocrat <hello@vendocr.at>\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -12,7 +13,6 @@ msgstr ""
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-KeywordsList: __;_e\n"
"Language: it\n"
"X-Poedit-SearchPath-0: ..\n"
#: ../classes/class-widget-payment-methods.php:33
@@ -60,18 +60,38 @@ msgid "Yes"
msgstr "Si"
#: ../classes/class-widget-payment-methods.php:121
msgid "Placement"
msgstr "Posizione"
#: ../classes/class-widget-payment-methods.php:123
msgid "Top"
msgstr "Sopra"
#: ../classes/class-widget-payment-methods.php:124
msgid "Right"
msgstr "Destra"
#: ../classes/class-widget-payment-methods.php:125
msgid "Bottom"
msgstr "Abbasso"
#: ../classes/class-widget-payment-methods.php:126
msgid "Left"
msgstr "Sinistra"
#: ../classes/class-widget-payment-methods.php:130
msgid "Extra classes"
msgstr "Classi extra"
#: ../payment-methods.php:220 ../payment-methods.php:260
#: ../payment-methods.php:266 ../payment-methods.php:271
#: ../payment-methods.php:221 ../payment-methods.php:261
#: ../payment-methods.php:267 ../payment-methods.php:272
msgid "Bank Transfer"
msgstr "Trasferimento bancario"
#: ../payment-methods.php:224
#: ../payment-methods.php:225
msgid "Pay with Cheque"
msgstr "Paga con assegno"
#: ../payment-methods.php:292
#: ../payment-methods.php:293
msgid "Cash on Delivery"
msgstr "Pagamento con contrassegno"
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: WooCommerce Payment Methods\n"
"POT-Creation-Date: 2014-09-08 01:40+0100\n"
"PO-Revision-Date: 2014-09-08 01:40+0100\n"
"POT-Creation-Date: 2014-09-15 03:10+0100\n"
"PO-Revision-Date: 2014-09-15 03:10+0100\n"
"Last-Translator: \n"
"Language-Team: vendocrat <hello@vendocr.at>\n"
"Language: en\n"
@@ -60,18 +60,38 @@ msgid "Yes"
msgstr ""
#: ../classes/class-widget-payment-methods.php:121
msgid "Placement"
msgstr ""
#: ../classes/class-widget-payment-methods.php:123
msgid "Top"
msgstr ""
#: ../classes/class-widget-payment-methods.php:124
msgid "Right"
msgstr ""
#: ../classes/class-widget-payment-methods.php:125
msgid "Bottom"
msgstr ""
#: ../classes/class-widget-payment-methods.php:126
msgid "Left"
msgstr ""
#: ../classes/class-widget-payment-methods.php:130
msgid "Extra classes"
msgstr ""
#: ../payment-methods.php:220 ../payment-methods.php:260
#: ../payment-methods.php:266 ../payment-methods.php:271
#: ../payment-methods.php:221 ../payment-methods.php:261
#: ../payment-methods.php:267 ../payment-methods.php:272
msgid "Bank Transfer"
msgstr ""
#: ../payment-methods.php:224
#: ../payment-methods.php:225
msgid "Pay with Cheque"
msgstr ""
#: ../payment-methods.php:292
#: ../payment-methods.php:293
msgid "Cash on Delivery"
msgstr ""
@@ -3,7 +3,7 @@
/* Plugin Name: WooCommerce Payment Methods (by vendocrat)
* Plugin URI: http://vendocr.at/
* Description: <strong>Easily display your accepted payment methods from WooCommerce.</strong> Handcrafted with &hearts; by <a href='http://vendocr.at/'>vendocrat</a> in Vienna.
* Version: 0.1.1
* Version: 0.1.2
* Author: vendocrat
* Author URI: http://vendocr.at/
* License: GNU General Public License v3.0
@@ -128,16 +128,17 @@ class vendocrat_Woo_Payment_Methods {
* Woo Accepted Payment Methods
*
* @since 2014-09-07
* @version 2014-09-08
* @version 2014-09-15
**************************************************/
function get_payment_methods( $atts = array(), $content = null ) {
extract(
shortcode_atts(
array(
'methods' => array(), // keys are the gateway slugs (lowercase) for the icon class, values are the title attributes
'style' => 'default', // default, inverse, o/outline
'tooltip' => false, // adds data attributes to icon to be used for diplaying tooltips (made for Bootstrap)
'xclass' => false, // add any extra classes, seperated by a space
'methods' => array(), // keys are the gateway slugs (lowercase) for the icon class, values are the title attributes
'style' => 'default', // default, inverse, o/outline
'tooltip' => false, // adds data attributes to icon to be used for diplaying tooltips (made for Bootstrap)
'placement' => 'bottom', // set tooltip placement (new since 0.1.2)
'xclass' => false, // add any extra classes, seperated by a space
), $atts
)
);
@@ -183,7 +184,7 @@ class vendocrat_Woo_Payment_Methods {
$icon = '<i';
$icon.= ($class) ? ' class="'. esc_attr( trim($class) ) .'"' : '';
$icon.= ($title) ? ' title="'. esc_attr( trim($title) ) .'"' : '';
$icon.= ($tooltip) ? ' data-toggle="tooltip" data-placement="bottom"' : '';
$icon.= ($tooltip AND $placement) ? ' data-toggle="tooltip" data-placement="'. $placement .'"' : '';
$icon.= '></i>';
break;
}
+5 -2
View File
@@ -4,7 +4,7 @@ Donate link: http://vendocr.at/donate/
Tags: woocommerce, credit card, logo, payment
Requires at least: 3.5
Tested up to: 4.1
Stable tag: 0.1.1
Stable tag: 0.1.2
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -54,4 +54,7 @@ Note: As we're using a webfont called <a href="https://github.com/orlandotm/paym
Initial release.
= 0.1.1 =
Fixed wrong url and typo in readme, updated shortcode and screenshots.
Fixed wrong url and typo in readme, updated shortcode and screenshots.
= 0.1.2 =
Fixed an error in widget class, added placement option to tooltips, updated language files.