Reputation
243
Top tag
Next privilege 250 Rep.
View close votes
Badges
1 6 16
Impact
~29k people reached

Sep
4
accepted How to validate custom fields in custom post type?
Sep
4
comment How to validate custom fields in custom post type?
ok, I think I got it. The magic is with the add_option and get_option wordpress functions to store and retrieve the variable, and the shutdown hook is useful to call the add_option function only once per session after everything is done.
Sep
4
comment How to validate custom fields in custom post type?
I'm not quite clear on what are you using to allow variables to persist across requests. Is it the inclusion of the $instance variable? Or is it one of the add_action statements? Or both? Something else?
Aug
30
comment How to validate custom fields in custom post type?
Example code: pastebin.com/vTxv9cw1
Aug
30
asked using new WP_Query in save_post function alters $post
Aug
30
comment How to validate custom fields in custom post type?
This only appears to work when the page is loaded for the first time. If the "Update/Publish" button is clicked, no notices are displayed.
Aug
29
comment Shortcode attribute “title” doesn't appear in $atts array
That was my question. I tried [bhours shortcode="test" compress="true" title="my title"], but the title attribute still didn't appear.
Aug
29
comment How to validate custom fields in custom post type?
I'm not quite clear on this...does your example code require 3rd-party code, or will it work in wordpress as-is?
Aug
28
awarded  Student
Aug
28
asked How to validate custom fields in custom post type?
Aug
28
comment Shortcode attribute “title” doesn't appear in $atts array
If I use the code as you suggest, the value of the title attribute does not get passed to the $title variable. However, the $shortcode variable works fine. Again, this brings us back to the original question--why does "title" not appear in the $atts array? After all, you still need it to appear in the array in order to access it with the extract function.
Aug
28
comment Shortcode attribute “title” doesn't appear in $atts array
The problem is that I want to be able to tell the difference between [bhours title=""], [bhours title="my title"], and [bhours], so I don't necessarily want to set a default value.
Aug
28
comment Shortcode attribute “title” doesn't appear in $atts array
Of course. There was no mention of this issue.
Aug
28
asked Shortcode attribute “title” doesn't appear in $atts array
Aug
28
accepted add_shortcode() not working inside of function
Aug
27
asked add_shortcode() not working inside of function
May
31
awarded  Scholar
May
31
accepted How to detect /category and /tag base pages?
May
29
awarded  Supporter
May
29
answered How to detect /category and /tag base pages?