Reputation
Next privilege 200 Rep.
See reduced ads
Badges
2 12
Impact
~12k people reached

  • 0 posts edited
  • 0 helpful flags
  • 9 votes cast
Aug
22
asked The Correct Way to Use Nonce Field without Settings API
Aug
22
accepted List of Default Translated Phrases
Aug
22
awarded  Student
Aug
22
revised Verify Submitted Form Values and Show Warning Messages with Setting API
added 3320 characters in body
Aug
22
asked List of Default Translated Phrases
Aug
22
comment Verify Submitted Form Values and Show Warning Messages with Setting API
I mean the saved value. The blank value shouldn't be saved as the verified value. It should be only saved as a preview value. You can confirm the problem with this step: 1. type any string value in the first field and save. 2. type an empty string in the first field and you get a warning message. 3. go to the admin dashboard. 4. come back to the plugin page. 5. you see the empty value is saved.
Aug
21
revised Verify Submitted Form Values and Show Warning Messages with Setting API
added 222 characters in body
Aug
21
accepted Adding Form Fields with Settings API
Aug
21
comment Adding Form Fields with Settings API
It seems the Settings API is designed to have one function per one field. So basically if there are 20 options, then there should be 20 functions.
Aug
21
comment Verify Submitted Form Values and Show Warning Messages with Setting API
Thanks indeed your updated code shows the custom warning message. I also updated the initial post and it has one last issue.
Aug
21
revised Verify Submitted Form Values and Show Warning Messages with Setting API
One last remaining issue.
Aug
21
revised Verify Submitted Form Values and Show Warning Messages with Setting API
Solved one remaining issue and updated the code
Aug
21
comment Verify Submitted Form Values and Show Warning Messages with Setting API
Still nothing happens. Including 'option-head.php' in the setting page didn't help. For testing, I removed the lines of if-clauses, if ($something) { return $input; } else {} int the validation_callback() function, but nothing happens. It just shows a yellow box saying options are updated as normal.
Aug
21
revised Verify Submitted Form Values and Show Warning Messages with Setting API
added 4656 characters in body
Aug
21
comment Verify Submitted Form Values and Show Warning Messages with Setting API
The default administration page allows the user to operate the minimum functionality without javascript regardless it is efficient or not. So as plugins.
Aug
21
comment Verify Submitted Form Values and Show Warning Messages with Setting API
One idea I have is that if the submitted values are invalid, save them as review values with a hidden option value indicating 'do not process.' And then show the warning message to the user. If the submitted values are all okey, save them separately to another group of hidden option fields. But how can I show the warning message without javascript?
Aug
21
comment Verify Submitted Form Values and Show Warning Messages with Setting API
The validation callback function does not seem to be able to interact with the admin page. add_action('admin_notices', 'print_errors'); does not do anything in my environment. I'm using v3.4.1.
Aug
21
comment Verify Submitted Form Values and Show Warning Messages with Setting API
Some users disable javascript in their browser. So it is not the ideal solution.
Aug
20
asked Verify Submitted Form Values and Show Warning Messages with Setting API
Aug
20
comment Adding Form Fields with Settings API
I see you are using check boxes. What if I want to put three more text fields with a label per each? The layout gets messed up. The form area is restricted to have a large left margin. It seems I have to use another function call for them.