Permalink Manager Lite - Version 0.4.3

Version Description

  • Hotfix for "Screen Options" save process.
Download this release

Release Info

Developer mbis
Plugin Icon 128x128 Permalink Manager Lite
Version 0.4.3
Comparing to
See all releases

Code changes from version 0.4.2 to 0.4.3

README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: mbis
3
  Tags: urls, permalinks, slugs, custom url, custom permalinks, uris, url, slug, permalink
4
  Requires at least: 4.0
5
  Tested up to: 4.5.3
6
- Stable tag: 0.4.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -82,6 +82,9 @@ After the plugin is installed you can access its dashboard from this page: `Tool
82
 
83
  == Changelog ==
84
 
 
 
 
85
  = 0.4.2 =
86
  * Hotfix for bulk actions' functions - additional conditional check for arrays added.
87
 
3
  Tags: urls, permalinks, slugs, custom url, custom permalinks, uris, url, slug, permalink
4
  Requires at least: 4.0
5
  Tested up to: 4.5.3
6
+ Stable tag: 0.4.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
82
 
83
  == Changelog ==
84
 
85
+ = 0.4.3 =
86
+ * Hotfix for "Screen Options" save process.
87
+
88
  = 0.4.2 =
89
  * Hotfix for bulk actions' functions - additional conditional check for arrays added.
90
 
inc/permalink-manager-actions.php CHANGED
@@ -18,7 +18,7 @@ class Permalink_Manager_Actions extends Permalink_Manager_Class {
18
  $updated_slugs_count = 0;
19
  $updated_array = array();
20
  $alert_type = $alert_content = $errors = $main_content = '';
21
- $old_uris = (is_array(get_option('permalink-manager-uris'))) ? get_option('permalink-manager-uris') : array();
22
 
23
  // Prepare default variables from $_POST object
24
  $old_string = esc_sql($_POST['permalink-manager']['find-replace']['old_string']);
@@ -87,8 +87,8 @@ class Permalink_Manager_Actions extends Permalink_Manager_Class {
87
  $post_statuses_array = ($_POST['permalink-manager']['regenerate_slugs']['post_statuses']);
88
  $mode = isset($_POST['permalink-manager']['regenerate_slugs']['variant']) ? $_POST['permalink-manager']['regenerate_slugs']['variant'] : array('slugs');
89
 
90
- $old_uris = (is_array(get_option('permalink-manager-uris'))) ? get_option('permalink-manager-uris') : array();
91
- $all_permastructs = (is_array(get_option('permalink-manager-permastructs'))) ? get_option('permalink-manager-permastructs') : array();
92
 
93
  // Reset query
94
  $reset_query = new WP_Query( array( 'post_type' => $post_types_array, 'post_status' => $post_statuses_array, 'posts_per_page' => -1 ) );
@@ -155,7 +155,7 @@ class Permalink_Manager_Actions extends Permalink_Manager_Class {
155
  $updated_array = array();
156
  $alert_type = $alert_content = $errors = $main_content = '';
157
 
158
- $old_uris = (is_array(get_option('permalink-manager-uris'))) ? get_option('permalink-manager-uris') : array();
159
  $new_uris = isset($_POST['uri']) ? $_POST['uri'] : array();
160
 
161
  // Double check if the slugs and ids are stored in arrays
@@ -209,7 +209,7 @@ class Permalink_Manager_Actions extends Permalink_Manager_Class {
209
  static function update_permastructs() {
210
  // Setup needed variables
211
  $alert_type = $alert_content = $errors = $main_content = '';
212
- $old_permastructs = (is_array(get_option('permalink-manager-permastructs'))) ? get_option('permalink-manager-permastructs') : array();
213
  $new_permastructs = array_filter($_POST['permalink-manager']['custom-permastructs']);
214
 
215
  foreach($new_permastructs as $post_type => $new_permstruct) {
18
  $updated_slugs_count = 0;
19
  $updated_array = array();
20
  $alert_type = $alert_content = $errors = $main_content = '';
21
+ $old_uris = get_option('permalink-manager-uris', array());
22
 
23
  // Prepare default variables from $_POST object
24
  $old_string = esc_sql($_POST['permalink-manager']['find-replace']['old_string']);
87
  $post_statuses_array = ($_POST['permalink-manager']['regenerate_slugs']['post_statuses']);
88
  $mode = isset($_POST['permalink-manager']['regenerate_slugs']['variant']) ? $_POST['permalink-manager']['regenerate_slugs']['variant'] : array('slugs');
89
 
90
+ $old_uris = get_option('permalink-manager-uris', array());
91
+ $all_permastructs = get_option('permalink-manager-permastructs', array());
92
 
93
  // Reset query
94
  $reset_query = new WP_Query( array( 'post_type' => $post_types_array, 'post_status' => $post_statuses_array, 'posts_per_page' => -1 ) );
155
  $updated_array = array();
156
  $alert_type = $alert_content = $errors = $main_content = '';
157
 
158
+ $old_uris = get_option('permalink-manager-uris', array());
159
  $new_uris = isset($_POST['uri']) ? $_POST['uri'] : array();
160
 
161
  // Double check if the slugs and ids are stored in arrays
209
  static function update_permastructs() {
210
  // Setup needed variables
211
  $alert_type = $alert_content = $errors = $main_content = '';
212
+ $old_permastructs = get_option('permalink-manager-permastructs', array());
213
  $new_permastructs = array_filter($_POST['permalink-manager']['custom-permastructs']);
214
 
215
  foreach($new_permastructs as $post_type => $new_permstruct) {
inc/permalink-manager-helper-functions.php CHANGED
@@ -113,6 +113,17 @@ class Permalink_Manager_Helper_Functions extends Permalink_Manager_Class {
113
  return $output;
114
  }
115
 
 
 
 
 
 
 
 
 
 
 
 
116
  /**
117
  * Display the permalink in a better way
118
  */
113
  return $output;
114
  }
115
 
116
+ /**
117
+ * Save option
118
+ */
119
+ static function save_option($field = null, $value = null) {
120
+ $options = get_option('permalink-manager', array());
121
+ if($field) {
122
+ $options[$field] = $value;
123
+ update_option('permalink-manager', $options);
124
+ }
125
+ }
126
+
127
  /**
128
  * Display the permalink in a better way
129
  */
permalink-manager.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Permalink Manager
5
  * Plugin URI: http://maciejbis.net/
6
  * Description: A simple tool that allows to mass update of slugs that are used to build permalinks for Posts, Pages and Custom Post Types.
7
- * Version: 0.4.2
8
  * Author: Maciej Bis
9
  * Author URI: http://maciejbis.net/
10
  * License: GPL-2.0+
@@ -20,7 +20,7 @@ if ( ! defined( 'WPINC' ) ) {
20
 
21
  // Define the directories used to load plugin files.
22
  define( 'PERMALINK_MANAGER_PLUGIN_NAME', 'permalink-manager' );
23
- define( 'PERMALINK_MANAGER_VERSION', '0.4.1' );
24
  define( 'PERMALINK_MANAGER_DIR', untrailingslashit( dirname( __FILE__ ) ) );
25
  define( 'PERMALINK_MANAGER_URL', untrailingslashit( plugins_url( '', __FILE__ ) ) );
26
  define( 'PERMALINK_MANAGER_WEBSITE', 'http://maciejbis.net' );
4
  * Plugin Name: Permalink Manager
5
  * Plugin URI: http://maciejbis.net/
6
  * Description: A simple tool that allows to mass update of slugs that are used to build permalinks for Posts, Pages and Custom Post Types.
7
+ * Version: 0.4.3
8
  * Author: Maciej Bis
9
  * Author URI: http://maciejbis.net/
10
  * License: GPL-2.0+
20
 
21
  // Define the directories used to load plugin files.
22
  define( 'PERMALINK_MANAGER_PLUGIN_NAME', 'permalink-manager' );
23
+ define( 'PERMALINK_MANAGER_VERSION', '0.4.3' );
24
  define( 'PERMALINK_MANAGER_DIR', untrailingslashit( dirname( __FILE__ ) ) );
25
  define( 'PERMALINK_MANAGER_URL', untrailingslashit( plugins_url( '', __FILE__ ) ) );
26
  define( 'PERMALINK_MANAGER_WEBSITE', 'http://maciejbis.net' );