Contact Widgets - Version 1.3.2

Version Description

  • August 16, 2016 =

  • WordPress 4.6 compatibility

  • Fix bug with edit button not working

  • Plugin icon update

  • Update translation

  • New: Add RSS to social networks.

Props @jonathanbardo, @fjarrett

Download this release

Release Info

Developer jonathanbardo
Plugin Icon 128x128 Contact Widgets
Version 1.3.2
Comparing to
See all releases

Code changes from version 1.3.1 to 1.3.2

assets/js/customize-preview-helper.js CHANGED
@@ -1,9 +1,9 @@
1
- ( function ( $ ) {
2
 
3
- $( document ).on( 'click', '.wpcw-widgets', function() {
4
 
5
- wp.customize.WidgetCustomizerPreview.preview.send( 'focus-widget-control', $( this ).prop( 'id' ) );
6
 
7
  });
8
 
9
- } )( jQuery );
1
+ ( function ( $, api ) {
2
 
3
+ $( document ).on( 'click', '.wpcw-widgets a.post-edit-link', function() {
4
 
5
+ api.WidgetCustomizerPreview.preview.send( 'focus-widget-control', $( this ).data( 'widget-id' ) );
6
 
7
  });
8
 
9
+ } )( jQuery, wp.customize );
assets/js/customize-preview-helper.min.js CHANGED
@@ -1 +1 @@
1
- !function(a){a(document).on("click",".wpcw-widgets",function(){wp.customize.WidgetCustomizerPreview.preview.send("focus-widget-control",a(this).prop("id"))})}(jQuery);
1
+ !function(a,b){a(document).on("click",".wpcw-widgets a.post-edit-link",function(){b.WidgetCustomizerPreview.preview.send("focus-widget-control",a(this).data("widget-id"))})}(jQuery,wp.customize);
contact-widgets.php CHANGED
@@ -2,11 +2,15 @@
2
  /**
3
  * Plugin Name: Contact Widgets
4
  * Description: Beautifully display social media and contact information on your website with these simple widgets.
5
- * Version: 1.3.1
6
  * Author: GoDaddy
7
  * Author URI: https://godaddy.com
8
  * Text Domain: contact-widgets
9
  * Domain Path: /languages
 
 
 
 
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
@@ -42,7 +46,7 @@ if ( ! class_exists( 'Contact_Widgets' ) ) {
42
 
43
  static::$assets_url = plugin_dir_url( __FILE__ ) . 'assets/';
44
 
45
- $composer_autoloader = dirname( __FILE__ ) . '/vendor/autoload.php';
46
 
47
  if ( defined( 'WP_CLI' ) && WP_CLI && file_exists( $composer_autoloader ) ) {
48
 
@@ -61,7 +65,7 @@ if ( ! class_exists( 'Contact_Widgets' ) ) {
61
 
62
  }
63
 
64
- require_once dirname( __FILE__ ) . '/includes/autoload.php';
65
 
66
  }
67
 
2
  /**
3
  * Plugin Name: Contact Widgets
4
  * Description: Beautifully display social media and contact information on your website with these simple widgets.
5
+ * Version: 1.3.2
6
  * Author: GoDaddy
7
  * Author URI: https://godaddy.com
8
  * Text Domain: contact-widgets
9
  * Domain Path: /languages
10
+ * License: GPL-2.0
11
+ * License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
+ *
13
+ * Copyright © 2016 GoDaddy Operating Company, LLC. All Rights Reserved.
14
  */
15
 
16
  if ( ! defined( 'ABSPATH' ) ) {
46
 
47
  static::$assets_url = plugin_dir_url( __FILE__ ) . 'assets/';
48
 
49
+ $composer_autoloader = __DIR__ . '/vendor/autoload.php';
50
 
51
  if ( defined( 'WP_CLI' ) && WP_CLI && file_exists( $composer_autoloader ) ) {
52
 
65
 
66
  }
67
 
68
+ require_once __DIR__ . '/includes/autoload.php';
69
 
70
  }
71
 
includes/class-base-widget.php CHANGED
@@ -422,7 +422,6 @@ abstract class Base_Widget extends \WP_Widget {
422
  protected function before_widget( array $args, array &$fields ) {
423
 
424
  $title = array_shift( $fields );
425
-
426
  echo $args['before_widget'];
427
 
428
  if ( ! empty( $title['value'] ) ) {
@@ -454,7 +453,7 @@ abstract class Base_Widget extends \WP_Widget {
454
 
455
  echo '</ul>';
456
 
457
- if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
458
 
459
  // admin-bar.php -> wp_admin_bar_customize_menu()
460
  $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
@@ -471,7 +470,8 @@ abstract class Base_Widget extends \WP_Widget {
471
  );
472
 
473
  printf(
474
- '<a class="post-edit-link" href="%s">%s</a>',
 
475
  esc_url( $edit_url ),
476
  __( 'Edit' )
477
  );
@@ -549,7 +549,13 @@ abstract class Base_Widget extends \WP_Widget {
549
 
550
  if ( is_customize_preview() ) {
551
 
552
- wp_enqueue_script( 'wpcw-helper', \Contact_Widgets::$assets_url . "js/customize-preview-helper{$suffix}.js", [], Plugin::$version );
 
 
 
 
 
 
553
 
554
  }
555
 
422
  protected function before_widget( array $args, array &$fields ) {
423
 
424
  $title = array_shift( $fields );
 
425
  echo $args['before_widget'];
426
 
427
  if ( ! empty( $title['value'] ) ) {
453
 
454
  echo '</ul>';
455
 
456
+ if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) && isset( $args['id'] ) ) {
457
 
458
  // admin-bar.php -> wp_admin_bar_customize_menu()
459
  $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
470
  );
471
 
472
  printf(
473
+ '<a class="post-edit-link" data-widget-id="%s" href="%s">%s</a>',
474
+ esc_attr( $args['widget_id'] ),
475
  esc_url( $edit_url ),
476
  __( 'Edit' )
477
  );
549
 
550
  if ( is_customize_preview() ) {
551
 
552
+ if ( ! wp_script_is( 'jquery', 'enqueued' ) ) {
553
+
554
+ wp_enqueue_script( 'jquery' );
555
+
556
+ }
557
+
558
+ wp_enqueue_script( 'wpcw-helper', \Contact_Widgets::$assets_url . "js/customize-preview-helper{$suffix}.js", [ 'jquery' ], Plugin::$version, true );
559
 
560
  }
561
 
includes/social-networks.php CHANGED
@@ -35,6 +35,10 @@ $fields = [
35
  'default' => "https://www.linkedin.com/in/{$username}",
36
  'select' => $username,
37
  ],
 
 
 
 
38
  'pinterest' => [
39
  'label' => __( 'Pinterest', 'contact-widgets' ),
40
  'default' => "https://www.pinterest.com/{$username}",
@@ -78,7 +82,8 @@ $fields = [
78
  'skype' => [
79
  'label' => __( 'Skype', 'contact-widgets' ),
80
  'default' => "skype:{$username}?chat",
81
- 'sanitizer' => 'sanitize_text_field',
 
82
  'select' => $username,
83
  ],
84
  'soundcloud' => [
35
  'default' => "https://www.linkedin.com/in/{$username}",
36
  'select' => $username,
37
  ],
38
+ 'rss' => [
39
+ 'label' => __( 'RSS feed', 'contact-widgets' ),
40
+ 'default' => get_feed_link(),
41
+ ],
42
  'pinterest' => [
43
  'label' => __( 'Pinterest', 'contact-widgets' ),
44
  'default' => "https://www.pinterest.com/{$username}",
82
  'skype' => [
83
  'label' => __( 'Skype', 'contact-widgets' ),
84
  'default' => "skype:{$username}?chat",
85
+ 'sanitizer' => 'esc_attr',
86
+ 'escaper' => 'esc_attr',
87
  'select' => $username,
88
  ],
89
  'soundcloud' => [
languages/contact-widgets-da_DK.mo CHANGED
Binary file
languages/contact-widgets-de_DE.mo CHANGED
Binary file
languages/contact-widgets-el.mo CHANGED
Binary file
languages/contact-widgets-es_ES.mo CHANGED
Binary file
languages/contact-widgets-es_MX.mo CHANGED
Binary file
languages/contact-widgets-fi.mo CHANGED
Binary file
languages/contact-widgets-fr_FR.mo CHANGED
Binary file
languages/contact-widgets-hi_IN.mo CHANGED
Binary file
languages/contact-widgets-id_ID.mo CHANGED
Binary file
languages/contact-widgets-it_IT.mo CHANGED
Binary file
languages/contact-widgets-ja.mo CHANGED
Binary file
languages/contact-widgets-ko_KR.mo CHANGED
Binary file
languages/contact-widgets-mr.mo CHANGED
Binary file
languages/contact-widgets-ms_MY.mo CHANGED
Binary file
languages/contact-widgets-nb_NO.mo CHANGED
Binary file
languages/contact-widgets-nl_NL.mo CHANGED
Binary file
languages/contact-widgets-pl_PL.mo CHANGED
Binary file
languages/contact-widgets-pt_BR.mo CHANGED
Binary file
languages/contact-widgets-pt_PT.mo CHANGED
Binary file
languages/contact-widgets-ru_RU.mo CHANGED
Binary file
languages/contact-widgets-sv_SE.mo CHANGED
Binary file
languages/contact-widgets-th.mo CHANGED
Binary file
languages/contact-widgets-tl.mo CHANGED
Binary file
languages/contact-widgets-tr_TR.mo CHANGED
Binary file
languages/contact-widgets-uk.mo CHANGED
Binary file
languages/contact-widgets-vi.mo CHANGED
Binary file
languages/contact-widgets-zh_CN.mo CHANGED
Binary file
languages/contact-widgets-zh_HK.mo CHANGED
Binary file
languages/contact-widgets-zh_TW.mo CHANGED
Binary file
readme.txt CHANGED
@@ -2,8 +2,10 @@
2
  Contributors: godaddy, jonathanbardo, fjarrett
3
  Tags: widget, contact, social, sharing, share button, share buttons, share links, social icons, social media, facebook, twitter, google plus, instagram
4
  Requires at least: 4.4.2
5
- Tested up to: 4.5
6
- Stable tag: 1.3.1
 
 
7
 
8
  Beautifully display social media and contact information on your website with these simple widgets.
9
 
@@ -109,6 +111,16 @@ add_filter( 'wpcw_widget_social_custom_fields', function( $fields, $instance ) {
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
 
 
 
 
 
112
  = 1.3.1 - June 3, 2016 =
113
 
114
  * New: Language support for `mr`.
2
  Contributors: godaddy, jonathanbardo, fjarrett
3
  Tags: widget, contact, social, sharing, share button, share buttons, share links, social icons, social media, facebook, twitter, google plus, instagram
4
  Requires at least: 4.4.2
5
+ Tested up to: 4.6
6
+ Stable tag: 1.3.2
7
+ License: GPL-2.0
8
+ License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
 
10
  Beautifully display social media and contact information on your website with these simple widgets.
11
 
111
 
112
  == Changelog ==
113
 
114
+ = 1.3.2 - August 16, 2016 =
115
+
116
+ * WordPress 4.6 compatibility
117
+ * Fix bug with edit button not working
118
+ * Plugin icon update
119
+ * Update translation
120
+ * New: Add RSS to social networks.
121
+
122
+ Props [@jonathanbardo](https://github.com/jonathanbardo), [@fjarrett](https://github.com/fjarrett)
123
+
124
  = 1.3.1 - June 3, 2016 =
125
 
126
  * New: Language support for `mr`.