Widget Settings Importer/Exporter - Version 1.4

Version Description

Download this release

Release Info

Developer kevinlangleyjr
Plugin Icon wp plugin Widget Settings Importer/Exporter
Version 1.4
Comparing to
See all releases

Code changes from version 1.3.1 to 1.4

Files changed (3) hide show
  1. class-widget-data.php +7 -1
  2. readme.txt +2 -2
  3. widget-data.php +1 -1
class-widget-data.php CHANGED
@@ -233,6 +233,7 @@ class Widget_Data {
233
  $widgets_array = array( );
234
  foreach ( $widgets as $widget ) {
235
  $widget_val = get_option( 'widget_' . $widget['type'] );
 
236
  $multiwidget_val = $widget_val['_multiwidget'];
237
  $widgets_array[$widget['type']][$widget['type-index']] = $widget_val[$widget['type-index']];
238
  if ( isset( $widgets_array[$widget['type']]['_multiwidget'] ) )
@@ -295,8 +296,10 @@ class Widget_Data {
295
  if ( isset( $new_widgets ) && isset( $current_sidebars ) ) {
296
  update_option( 'sidebars_widgets', $current_sidebars );
297
 
298
- foreach ( $new_widgets as $title => $content )
 
299
  update_option( 'widget_' . $title, $content );
 
300
 
301
  return true;
302
  }
@@ -313,6 +316,9 @@ class Widget_Data {
313
  header( "Content-Description: File Transfer" );
314
  header( "Content-Disposition: attachment; filename=widget_data.json" );
315
  header( "Content-Type: application/octet-stream" );
 
 
 
316
  echo self::parse_export_data( $_POST );
317
  exit;
318
  }
233
  $widgets_array = array( );
234
  foreach ( $widgets as $widget ) {
235
  $widget_val = get_option( 'widget_' . $widget['type'] );
236
+ $widget_val = apply_filters( 'widget_data_export', $widget_val, $widget['type'] );
237
  $multiwidget_val = $widget_val['_multiwidget'];
238
  $widgets_array[$widget['type']][$widget['type-index']] = $widget_val[$widget['type-index']];
239
  if ( isset( $widgets_array[$widget['type']]['_multiwidget'] ) )
296
  if ( isset( $new_widgets ) && isset( $current_sidebars ) ) {
297
  update_option( 'sidebars_widgets', $current_sidebars );
298
 
299
+ foreach ( $new_widgets as $title => $content ) {
300
+ $content = apply_filters( 'widget_data_import', $content, $title );
301
  update_option( 'widget_' . $title, $content );
302
+ }
303
 
304
  return true;
305
  }
316
  header( "Content-Description: File Transfer" );
317
  header( "Content-Disposition: attachment; filename=widget_data.json" );
318
  header( "Content-Type: application/octet-stream" );
319
+ unset($_POST['action']);
320
+ unset($_POST['_wpnonce']);
321
+ unset($_POST['_wp_http_referer']);
322
  echo self::parse_export_data( $_POST );
323
  exit;
324
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: kevinlangleyjr, smccafferty, markparolisi, voceplatforms
3
  Tags: widget, import, export
4
  Requires at least: 2.8
5
  Tested up to: 3.9.1
6
- Stable tag: 1.3.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -39,4 +39,4 @@ See Frequently Asked Questions here: https://github.com/voceconnect/widget-data/
39
 
40
  == Changelog ==
41
 
42
- Please refer to full changelog at https://github.com/voceconnect/widget-data/releases.
3
  Tags: widget, import, export
4
  Requires at least: 2.8
5
  Tested up to: 3.9.1
6
+ Stable tag: 1.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
39
 
40
  == Changelog ==
41
 
42
+ Please refer to full changelog at https://github.com/voceconnect/widget-data/releases.
widget-data.php CHANGED
@@ -4,7 +4,7 @@
4
  Description: Adds functionality to export and import widget data
5
  Author: Voce Communications - Kevin Langley, Sean McCafferty, Mark Parolisi
6
  Author URI: http://vocecommunications.com
7
- Version: 1.3.1
8
  * ******************************************************************
9
  Copyright 2011-2011 Voce Communications
10
 
4
  Description: Adds functionality to export and import widget data
5
  Author: Voce Communications - Kevin Langley, Sean McCafferty, Mark Parolisi
6
  Author URI: http://vocecommunications.com
7
+ Version: 1.4
8
  * ******************************************************************
9
  Copyright 2011-2011 Voce Communications
10