123 reputation
8
bio website
location
age
visits member for 1 year, 11 months
seen Sep 27 '12 at 15:52

My account seems to be hacked by some of the moderators. This profile also got changed by somebody a few times. I migrated to Quora, an awesome Q & A web site. I feel very comfortable there.


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.
Aug
20
comment Adding Form Fields with Settings API
Would you mind showing an example? If I put more than one form inputs in one field function-callback, then the layout gets largely indented. Also, each callback function has this line $options = get_option('settingsapi_optionname'); Loading an option for one option looks ridiculous when the number of options becomes large.
Aug
20
comment Adding Form Fields with Settings API
So do I have to create a function per option? Isn't it too much? What if there are 20 options to save? Create 20 functions for it?
Aug
20
accepted Retrieve Path of admin.php
Aug
20
asked Adding Form Fields with Settings API
Aug
20
awarded  Commentator
Aug
20
comment Retrieve Path of admin.php
So is ABSPATH the most reliable way?