Social Media Feather | social media sharing - Version 1.9.4

Version Description

  • Removed deprecated function "create_function".
  • Utilizing WP Settings API.
  • WP 5+ compatability tests.
Download this release

Release Info

Developer socialmediafeather
Plugin Icon 128x128 Social Media Feather | social media sharing
Version 1.9.4
Comparing to
See all releases

Code changes from version 1.8.4 to 1.9.4

readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: socialmediafeather
3
  Tags: social media, social sharing, social buttons, Facebook, Share, Like, twitter, google, Reddit, youtube, instagram, pinterest, social media buttons, button, shortcode, sidebar, sharing buttons, follow buttons
4
  Requires at least: 3.1
5
- Tested up to: 4.7
6
- Stable tag: 1.8.4
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -191,6 +191,11 @@ margin-left: 10px;
191
 
192
  == Changelog ==
193
 
 
 
 
 
 
194
  = 1.8.4 =
195
  * Added option to decline terms of service after having accepted
196
 
2
  Contributors: socialmediafeather
3
  Tags: social media, social sharing, social buttons, Facebook, Share, Like, twitter, google, Reddit, youtube, instagram, pinterest, social media buttons, button, shortcode, sidebar, sharing buttons, follow buttons
4
  Requires at least: 3.1
5
+ Tested up to: 5.2.2
6
+ Stable tag: 1.9.4
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
191
 
192
  == Changelog ==
193
 
194
+ = 1.9.4 =
195
+ * Removed deprecated function "create_function".
196
+ * Utilizing WP Settings API.
197
+ * WP 5+ compatability tests.
198
+
199
  = 1.8.4 =
200
  * Added option to decline terms of service after having accepted
201
 
social-media-feather.php CHANGED
@@ -4,11 +4,11 @@ Plugin Name: Social Media Feather
4
  Plugin URI: http://socialmediafeather.com/
5
  Description: Super lightweight social media plugin to add nice and effective social media sharing and following buttons and icons anywhere on your site quickly and easily
6
  Author: socialmediafeather
7
- Version: 1.8.4
8
  Author URI: http://socialmediafeather.com/
9
  */
10
 
11
- define( 'SYNVED_VERSION', '1.8.4' );
12
 
13
  if (!function_exists('synved_wp_social_load'))
14
  {
4
  Plugin URI: http://socialmediafeather.com/
5
  Description: Super lightweight social media plugin to add nice and effective social media sharing and following buttons and icons anywhere on your site quickly and easily
6
  Author: socialmediafeather
7
+ Version: 1.9.4
8
  Author URI: http://socialmediafeather.com/
9
  */
10
 
11
+ define( 'SYNVED_VERSION', '1.9.4' );
12
 
13
  if (!function_exists('synved_wp_social_load'))
14
  {
synved-option/synved-option-page.php CHANGED
@@ -94,7 +94,7 @@ function synved_option_page_cb($id, $name, $item)
94
  <?php settings_fields($group); ?>
95
  <?php
96
  $page_slug = synved_option_page_slug($id, $name, $item);
97
- synved_option_render_page($page_slug);
98
  ?>
99
  <p class="submit">
100
  <input name="Submit" type="submit" class="button-primary" value="<?php esc_attr_e('Save Changes'); ?>" />
@@ -146,7 +146,10 @@ function synved_option_page_cb($id, $name, $item)
146
  function synved_option_page_add($id, $name, $item)
147
  {
148
  global $synved_option_list;
149
-
 
 
 
150
  $type = synved_option_item_type($item);
151
 
152
  if ($type == 'options-page')
@@ -162,13 +165,19 @@ function synved_option_page_add($id, $name, $item)
162
  }
163
 
164
  $page_slug = $id . '_' . $name;
165
-
166
- $addfunc = 'add_' . /* */ 'subm' . 'enu_page';
167
- $page = $addfunc($parent, $label, $label, $role, $page_slug, create_function('', 'return synved_option_page_cb(\'' . $id . '\', \'' . $name . '\', synved_option_item_find(\'' . $id . '\', \'' . $name . '\'));'));
 
 
 
 
 
 
168
 
169
  $synved_option_list[$id]['pages'][$name]['wp-page-slug'] = $page_slug;
170
  $synved_option_list[$id]['pages'][$name]['wp-page'] = $page;
171
-
172
  return $page;
173
  }
174
 
94
  <?php settings_fields($group); ?>
95
  <?php
96
  $page_slug = synved_option_page_slug($id, $name, $item);
97
+ do_settings_sections( $page_slug );
98
  ?>
99
  <p class="submit">
100
  <input name="Submit" type="submit" class="button-primary" value="<?php esc_attr_e('Save Changes'); ?>" />
146
  function synved_option_page_add($id, $name, $item)
147
  {
148
  global $synved_option_list;
149
+
150
+ define('SYNVEDOPTION', $id);
151
+ define('SYNVEDNAME', $name);
152
+
153
  $type = synved_option_item_type($item);
154
 
155
  if ($type == 'options-page')
165
  }
166
 
167
  $page_slug = $id . '_' . $name;
168
+
169
+ $page = add_submenu_page(
170
+ $parent,
171
+ $label,
172
+ $label,
173
+ $role,
174
+ $page_slug,
175
+ function($name){ return synved_option_page_cb(SYNVEDOPTION, SYNVEDNAME, synved_option_item_find(SYNVEDOPTION, SYNVEDNAME) ); }
176
+ );
177
 
178
  $synved_option_list[$id]['pages'][$name]['wp-page-slug'] = $page_slug;
179
  $synved_option_list[$id]['pages'][$name]['wp-page'] = $page;
180
+
181
  return $page;
182
  }
183
 
synved-option/synved-option.php CHANGED
@@ -305,7 +305,7 @@ function synved_option_callback_create($callback_code, $callback_parameters = nu
305
  }
306
  }
307
 
308
- $callback = create_function($function_params, $callback_code);
309
 
310
  return synved_option_callback($callback, null, $callback_parameters);
311
  }
@@ -576,7 +576,10 @@ function synved_option_wp_handle_setting($id, $page, $section, $name, $item)
576
  $label = synved_option_item_label($item);
577
  $sections = isset($item['sections']) ? $item['sections'] : null;
578
  $settings = isset($item['settings']) ? $item['settings'] : null;
579
-
 
 
 
580
  if ($type == 'options-page')
581
  {
582
  if ($sections != null)
@@ -591,10 +594,8 @@ function synved_option_wp_handle_setting($id, $page, $section, $name, $item)
591
  }
592
  else if ($type == 'options-section')
593
  {
594
- add_settings_section($name, $label,
595
- create_function('', 'return synved_option_settings_section_cb(\'' . $name . '\', synved_option_item_find(\'' . $id . '\', \'' . $name . '\'));'),
596
- $page);
597
-
598
  if ($settings != null)
599
  {
600
  foreach ($settings as $child_name => $child_item)
@@ -823,7 +824,9 @@ function synved_option_wp_admin_init()
823
  $dbname = synved_option_name_default($id);
824
  $group = synved_option_group_default($id);
825
 
826
- register_setting($group, $dbname, create_function('$value', 'return synved_option_setting_sanitize_cb(\'' . $id . '\', $value);'));
 
 
827
 
828
  $items = synved_option_item_list($id);
829
 
305
  }
306
  }
307
 
308
+ $callback = function($function_params) { $callback_code; };
309
 
310
  return synved_option_callback($callback, null, $callback_parameters);
311
  }
576
  $label = synved_option_item_label($item);
577
  $sections = isset($item['sections']) ? $item['sections'] : null;
578
  $settings = isset($item['settings']) ? $item['settings'] : null;
579
+
580
+ $GLOBALS['name'] = $name;
581
+ $GLOBALS['id'] = $id;
582
+
583
  if ($type == 'options-page')
584
  {
585
  if ($sections != null)
594
  }
595
  else if ($type == 'options-section')
596
  {
597
+ add_settings_section($name, $label, function() { return synved_option_settings_section_cb($GLOBALS['name'], synved_option_item_find($GLOBALS['id'], $GLOBALS['name'])); }, $page);
598
+
 
 
599
  if ($settings != null)
600
  {
601
  foreach ($settings as $child_name => $child_item)
824
  $dbname = synved_option_name_default($id);
825
  $group = synved_option_group_default($id);
826
 
827
+ define( 'SYNVEDOPTIONID', $id );
828
+
829
+ register_setting($group, $dbname, synved_option_setting_sanitize_cb($id, $list));
830
 
831
  $items = synved_option_item_list($id);
832
 
synved-social/synved-social-setup.php CHANGED
@@ -108,7 +108,7 @@ function synved_social_provider_settings()
108
 
109
  $terms_accepted = synved_option_get('synved_social', 'accepted_sharethis_terms');
110
 
111
- $synved_social_options = array(
112
  'settings' => array(
113
  'label' => 'Social Media',
114
  'title' => 'Social Media Feather',
@@ -144,11 +144,6 @@ $synved_social_options = array(
144
  'default' => __('Hey check this out', 'social-media-feather'), 'label' => __('Default Message', 'social-media-feather'),
145
  'tip' => __('Specify the default message to use when sharing content, this is what gets replaced into the %%message%% variable', 'social-media-feather')
146
  ),
147
- // 'accepted_sharethis_terms' => array(
148
- // 'default' => false, 'label' => __('Extra Features', 'social-media-feather'),
149
- // 'tip' => __('Allows extra social features provided using JavaScript by accepting <a href="http://socialmediafeather.com/privacy">the terms</a>.', 'social-media-feather'),
150
- // 'hidden' => true
151
- // ),
152
  'hide_sharethis_terms' => array(
153
  'default' => false, 'label' => __('Hide Extra Features Prompt', 'social-media-feather'),
154
  'tip' => __('Don\'t prompt for extra features.', 'social-media-feather'),
108
 
109
  $terms_accepted = synved_option_get('synved_social', 'accepted_sharethis_terms');
110
 
111
+ $synved_social_options = array(
112
  'settings' => array(
113
  'label' => 'Social Media',
114
  'title' => 'Social Media Feather',
144
  'default' => __('Hey check this out', 'social-media-feather'), 'label' => __('Default Message', 'social-media-feather'),
145
  'tip' => __('Specify the default message to use when sharing content, this is what gets replaced into the %%message%% variable', 'social-media-feather')
146
  ),
 
 
 
 
 
147
  'hide_sharethis_terms' => array(
148
  'default' => false, 'label' => __('Hide Extra Features Prompt', 'social-media-feather'),
149
  'tip' => __('Don\'t prompt for extra features.', 'social-media-feather'),
synved-social/synved-social.php CHANGED
@@ -219,10 +219,6 @@ function synved_social_service_provider_list($context, $raw = false)
219
  'link' => 'https://twitter.com/intent/tweet?url=%%url%%&text=%%message%%',
220
  'title' => __('Share on Twitter'),
221
  ),
222
- 'google_plus' => array(
223
- 'link' => 'https://plus.google.com/share?url=%%url%%',
224
- 'title' => __('Share on Google+'),
225
- ),
226
  'reddit' => array(
227
  'link' => 'http://www.reddit.com/submit?url=%%url%%&title=%%title%%',
228
  'title' => __('Share on Reddit'),
@@ -257,10 +253,6 @@ function synved_social_service_provider_list($context, $raw = false)
257
  'link' => 'https://twitter.com/twitter',
258
  'title' => __('Follow us on Twitter'),
259
  ),
260
- 'google_plus' => array(
261
- 'link' => 'http://plus.google.com/needlessly_long_google_plus_id',
262
- 'title' => __('Follow us on Google+'),
263
- ),
264
  'pinterest' => array(
265
  'link' => 'http://pinterest.com/MyUserName/',
266
  'title' => __('Our board on Pinterest'),
219
  'link' => 'https://twitter.com/intent/tweet?url=%%url%%&text=%%message%%',
220
  'title' => __('Share on Twitter'),
221
  ),
 
 
 
 
222
  'reddit' => array(
223
  'link' => 'http://www.reddit.com/submit?url=%%url%%&title=%%title%%',
224
  'title' => __('Share on Reddit'),
253
  'link' => 'https://twitter.com/twitter',
254
  'title' => __('Follow us on Twitter'),
255
  ),
 
 
 
 
256
  'pinterest' => array(
257
  'link' => 'http://pinterest.com/MyUserName/',
258
  'title' => __('Our board on Pinterest'),