Version Description
Download this release
Release Info
Developer | evertiro |
Plugin | Username Changer |
Version | 3.1.3 |
Comparing to | |
See all releases |
Code changes from version 3.1.2 to 3.1.3
includes/libraries/s214-settings/source/class.s214-settings.php
CHANGED
@@ -124,7 +124,7 @@ class S214_Settings {
|
|
124 |
|
125 |
// Handle tooltips
|
126 |
add_filter( $this->func . '_after_setting_output', array( $this, 'add_setting_tooltip' ), 10, 2 );
|
127 |
-
|
128 |
add_filter( "pre_update_option_{$this->func}_settings", array( $this, 'multicheck_empty_validation' ), 10, 3 );
|
129 |
}
|
130 |
|
@@ -799,7 +799,7 @@ class S214_Settings {
|
|
799 |
|
800 |
if( ! empty( $args['options'] ) ) {
|
801 |
$html = '';
|
802 |
-
|
803 |
$html .= '<input type="hidden" name="' . $this->func . '_settings[_multicheck_fields][' . $args['id'] . ']' . '" value="' . $args['id'] . '">';
|
804 |
|
805 |
foreach( $args['options'] as $key => $option ) {
|
@@ -1238,7 +1238,7 @@ class S214_Settings {
|
|
1238 |
|
1239 |
return $html;
|
1240 |
}
|
1241 |
-
|
1242 |
/**
|
1243 |
* Hooks in on option pre-save and checks for empty multicheck groups. If no checkboxes in a group are checked,
|
1244 |
* the info about the fields are never passed to the $_POST array, and the updates are never saved.
|
@@ -1257,20 +1257,20 @@ class S214_Settings {
|
|
1257 |
* @return mixed The (maybe) updated option to be saved
|
1258 |
*/
|
1259 |
public function multicheck_empty_validation( $value, $old_value, $option ) {
|
1260 |
-
|
1261 |
-
if( ! isset( $_POST[ $this->func . '_settings' ][ '_multicheck_fields' ] ) || empty(
|
1262 |
-
|
1263 |
return $value;
|
1264 |
}
|
1265 |
-
|
1266 |
foreach( $_POST[ $this->func . '_settings' ][ '_multicheck_fields' ] as $multicheck_field_name ) {
|
1267 |
-
|
1268 |
if( ! isset( $_POST[ $this->func . '_settings' ][ $multicheck_field_name ] ) || empty( $_POST[ $this->func . '_settings' ][ $multicheck_field_name ] ) ) {
|
1269 |
-
|
1270 |
$value[ $multicheck_field_name ] = [];
|
1271 |
}
|
1272 |
}
|
1273 |
-
|
1274 |
return $value;
|
1275 |
}
|
1276 |
}
|
124 |
|
125 |
// Handle tooltips
|
126 |
add_filter( $this->func . '_after_setting_output', array( $this, 'add_setting_tooltip' ), 10, 2 );
|
127 |
+
|
128 |
add_filter( "pre_update_option_{$this->func}_settings", array( $this, 'multicheck_empty_validation' ), 10, 3 );
|
129 |
}
|
130 |
|
799 |
|
800 |
if( ! empty( $args['options'] ) ) {
|
801 |
$html = '';
|
802 |
+
|
803 |
$html .= '<input type="hidden" name="' . $this->func . '_settings[_multicheck_fields][' . $args['id'] . ']' . '" value="' . $args['id'] . '">';
|
804 |
|
805 |
foreach( $args['options'] as $key => $option ) {
|
1238 |
|
1239 |
return $html;
|
1240 |
}
|
1241 |
+
|
1242 |
/**
|
1243 |
* Hooks in on option pre-save and checks for empty multicheck groups. If no checkboxes in a group are checked,
|
1244 |
* the info about the fields are never passed to the $_POST array, and the updates are never saved.
|
1257 |
* @return mixed The (maybe) updated option to be saved
|
1258 |
*/
|
1259 |
public function multicheck_empty_validation( $value, $old_value, $option ) {
|
1260 |
+
|
1261 |
+
if( ! isset( $_POST[ $this->func . '_settings' ][ '_multicheck_fields' ] ) || empty( $_POST[ $this->func . '_settings' ][ '_multicheck_fields' ] ) ) {
|
1262 |
+
|
1263 |
return $value;
|
1264 |
}
|
1265 |
+
|
1266 |
foreach( $_POST[ $this->func . '_settings' ][ '_multicheck_fields' ] as $multicheck_field_name ) {
|
1267 |
+
|
1268 |
if( ! isset( $_POST[ $this->func . '_settings' ][ $multicheck_field_name ] ) || empty( $_POST[ $this->func . '_settings' ][ $multicheck_field_name ] ) ) {
|
1269 |
+
|
1270 |
$value[ $multicheck_field_name ] = [];
|
1271 |
}
|
1272 |
}
|
1273 |
+
|
1274 |
return $value;
|
1275 |
}
|
1276 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://evertiro.com/donate/
|
|
4 |
Tags: user, username, display name, login
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.7.1
|
7 |
-
Stable tag: 3.1.
|
8 |
|
9 |
Change usernames easily
|
10 |
|
4 |
Tags: user, username, display name, login
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.7.1
|
7 |
+
Stable tag: 3.1.3
|
8 |
|
9 |
Change usernames easily
|
10 |
|
username-changer.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Username Changer
|
4 |
* Description: Change usernames easily
|
5 |
-
* Version: 3.1.
|
6 |
* Author: Daniel J Griffiths
|
7 |
* Author URI: https://evertiro.com
|
8 |
* Text Domain: username-changer
|
@@ -85,7 +85,7 @@ if ( ! class_exists( 'Username_Changer' ) ) {
|
|
85 |
define( 'USERNAME_CHANGER_URL', plugin_dir_url( __FILE__ ) );
|
86 |
|
87 |
// Plugin version
|
88 |
-
define( 'USERNAME_CHANGER_VER', '3.1.
|
89 |
}
|
90 |
|
91 |
|
2 |
/**
|
3 |
* Plugin Name: Username Changer
|
4 |
* Description: Change usernames easily
|
5 |
+
* Version: 3.1.3
|
6 |
* Author: Daniel J Griffiths
|
7 |
* Author URI: https://evertiro.com
|
8 |
* Text Domain: username-changer
|
85 |
define( 'USERNAME_CHANGER_URL', plugin_dir_url( __FILE__ ) );
|
86 |
|
87 |
// Plugin version
|
88 |
+
define( 'USERNAME_CHANGER_VER', '3.1.3' );
|
89 |
}
|
90 |
|
91 |
|