893 reputation
311
bio website
location
age
visits member for 3 years, 11 months
seen Aug 31 at 20:32

Jul
18
revised Order posts by custom field and if custom field is empty return remaining posts
changed left outer join to left join
Jul
2
awarded  Curious
Apr
12
comment How to end the excerpt with a sentence rather than a word?
There is a bug, it should be $excerpt instead of $data['post_excerpt'] in the first version.
Jan
22
awarded  Yearling
Apr
9
awarded  Critic
Apr
9
comment Proper hook for W3TC defines, or dynamically disable w3 total cache
This answer is not related to my question at all.
Feb
28
comment Control term order on a per-post basis
Thanks so much for this! there are a few bugs, but your code got me at least 80% of the way through creating this feature for a client, enabled me to do it super fast. Thanks again!
Jan
22
awarded  Yearling
Nov
20
comment How to display some settings for super admin user only using Settings API
I have this fully implemented now, thank you. I should note it's not necessary to use do_settings_fields() instead of do_settings_sections() if the admin-only settings section is added conditionally, as you described in your edited answer. To make sure options weren't overwritten, in the sanitize callback, I got the old values and looped through them, checking to see if each key exists in the newly submitted value. If the key doesn't exist, I set it in the new values array before returning it.
Nov
20
accepted How to display some settings for super admin user only using Settings API
Nov
20
comment How to display some settings for super admin user only using Settings API
Cheers, this would also work. However, I think I'm going with @toscho's answer because I believe it'd take less code to just conditionally add the admin-only settings section. I wouldn't have to change the markup with that solution either (not sure why he mentioned using 'do_settings_fields()' in the comments, as it turns out it isn't necessary).
Nov
20
comment How to display some settings for super admin user only using Settings API
Oh, are you saying to only include this callback for the admin-only settings, and use a different callback for the settings available to regular users?
Nov
20
comment How to display some settings for super admin user only using Settings API
It seems like this solution wouldn't output any editable fields for non admin users, amirite?
Nov
20
comment How to display some settings for super admin user only using Settings API
Also, if I'm using do_settings_fields() instead of do_settings_sections() -- I take it that I need to manually print the section titles and the table opening and closing tags, correct? Or is there a more elegant way to do this?
Nov
20
comment How to display some settings for super admin user only using Settings API
Thanks @toscho -- I've got the display working correctly now! Where would you suggest I do the check when I save the options.. in the callback specified in register_setting()?
Nov
20
asked How to display some settings for super admin user only using Settings API
Oct
24
answered how to restrict posts_request filter to the main query only
Oct
23
comment Proper hook for W3TC defines, or dynamically disable w3 total cache
@LarsKoudal I wasn't able to do what I asked in my original question, but I was able to turn off caching when people have items in their cart using this plugin wordpress.org/extend/plugins/shopp-cache-helper -- the plugin doesn't work directly out of the box though, you need to edit the w3 total cache settings and add the 'shopp_items_in_cart' cookie to the rejected cookies section under each caching type option.
Oct
1
awarded  Tumbleweed
Sep
24
asked Proper hook for W3TC defines, or dynamically disable w3 total cache