Comments (2)
In the future, please use the issue tracker here: (https://github.com/reduxframework/redux-framework). This beta repo is closed. I'll ask to have it taken down.
Change your validation function to this:
function validate_json( $field, $value, $existing_value ) {
$json = json_decode( $value );
if ( json_last_error() === JSON_ERROR_NONE ) {
$field['msg'] = '';
return array(
'value' => trim( $value ),
'error' => $field
);
}
$field['msg'] = esc_html__( 'You must enter valid JSON.', 'text-domain' );
return array(
'error' => $field,
'value' => trim( $existing_value ),
);
}
For custom validations, you'll have to pass a null or empty value to the field error and return it to make the message disappear on success.
from redux-framework-4.
Thanks for your response, I've opened a new issue in the other repo as the issue is JavaScript related, not PHP. So, while the validate_json() function was incorrect, it is unrelated to the bug.
from redux-framework-4.
Related Issues (20)
- assets css error in localost net::ERR_ABORTED 404 (Not Found) HOT 1
- Conflict with LifterLMS after 4.1.26 update in Redux HOT 10
- Conflict with bbPress. private parent forum gets unassigned HOT 1
- Fallback for Google Fonts to what's embedded. HOT 2
- Allow filesystem to gracefully fail to DB if file writing is disabled. HOT 1
- Add help window by clicking on ? to auto-submit a support URL and details. Also integrate support keys so the developers can be notified of a new message. HOT 1
- The background image preview exists even after removing the image
- Remove the donate button
- Fatal error on activation HOT 3
- Increase the select fields' widths HOT 2
- The spinner with two sliders field doesn't work properly HOT 1
- Warning: Undefined property: Redux_Multi_Text::$show_empty HOT 1
- Ad Remover Extension - Still getting charged for it HOT 11
- redux framework 4.3.1 JS and CSS files are not loaded HOT 5
- PHP Parse error in class-redux-embedded.php HOT 1
- WP 6 PHP Notice HOT 5
- Repeater in Custom Post Type Not Working
- The media field image preview box does not display the complete image
- Add custom JS file to redux framework
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-framework-4.