123 reputation
8
bio website
location
age
visits member for 1 year, 8 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
30
comment Where does WordPress default SimplePie save cache data?
As I test with my custom class extending the default WordPress SimplePie class, in addition to the above methods, set_cache_class('WP_Feed_Cache') and set_file_class('WP_SimplePie_File'), set_cache_duration(apply_filters('wp_feed_cache_transient_lifetime', $cacheduration, $url)) works fine without errors.
Aug
30
comment Where does WordPress default SimplePie save cache data?
Do you mean I should use set_transient() separately from SimplePie? Or are you suggesting that I should implement the function into the custom extended class?
Aug
30
comment Where does WordPress default SimplePie save cache data?
Thanks for the info. I looked into the source in feed.php and there are lines $feed->set_cache_class('WP_Feed_Cache'); $feed->set_file_class('WP_SimplePie_File'); It looks these are the ones setting a transient. I have a custom class which extends SimplePie which WordPress includes. In that case, can I just use these methods and simply pass the words, WP_Feed_Cache and WP_SimplePie_File?
Aug
23
comment The Correct Way to Use Nonce Field without Settings API
Could it be whatever assigned to the string value for the variable $nonce_key?
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
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
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
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
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
comment Retrieve Path of admin.php
So is ABSPATH the most reliable way?
Aug
20
comment Retrieve Path of admin.php
For the css file it works thanks but for admin.php, actually I need to use include() so I need the system path, not the url. If I include with url, I get Warning: require() [function.require]: http:// wrapper is disabled in the server configuration by allow_url_include=0
Aug
18
comment Localization Problem: Doesn't Display Translated Words
It turned out to be a problem of .mo file naming. CodeStyling Localization created a file named localizationsample-ja_JP.mo but it had to to be localizationsample-ja.mo, without _JP. I realized this by reading the source as you pointed out. It finally got working. Thank you so much.
Aug
18
comment Localization Problem: Doesn't Display Translated Words
I see indeed Codex was wrong. I'm testing with your suggestion now.
Aug
17
comment Localization Problem: Doesn't Display Translated Words
Ah, that's for load_textdomain() but the documentation of load_plugin_textdomain() also says "This function does not return a value." codex.wordpress.org/Function_Reference/load_plugin_textdomain