56 reputation
7
bio website
location
age
visits member for 2 years, 4 months
seen Aug 5 at 21:02

Web Developer for the Brewers Association. Wordpress aficionado - working on my ninja status.


Jul
8
awarded  Popular Question
Oct
18
comment Register Taxonomy earlier so it can be used in functions.php and admin-ajax.php
Strange isn't good, so please let me know if you have a better suggestion. Basically, the do_action routes the ajax call to the different php functions in functions.php (using add_action). Tutorial was from here, under "Best Practices"
Oct
17
answered Register Taxonomy earlier so it can be used in functions.php and admin-ajax.php
Oct
17
comment Register Taxonomy earlier so it can be used in functions.php and admin-ajax.php
Init was NOT performed. Script did not die when I added those lines. So this proves the taxonomy does NOT exist when that function is running...which brings me back to my original question - how do I 'init sooner'? (And thank you for your persistence in helping me with this problem. It's an odd one!)
Oct
17
comment Register Taxonomy earlier so it can be used in functions.php and admin-ajax.php
Yes, die() kills the script both on calendar_search() and before I register my taxonomy. Again, get_terms works everywhere on the page/site except in this one function.
Oct
17
comment Register Taxonomy earlier so it can be used in functions.php and admin-ajax.php
die() on the first line of calendar_search()? I will try right now. Yes, there might be another culprit involved. I have used this same code on another site and have never seen the particular error.
Oct
17
comment Register Taxonomy earlier so it can be used in functions.php and admin-ajax.php
I wish it were that easy! Still getting the same error. object(WP_Error)#188 (2) { ["errors"]=> array(1) { ["invalid_taxonomy"]=> array(1) { [0]=> string(16) "Invalid taxonomy" } } ["error_data"]=> array(0) { } }
Oct
17
comment Register Taxonomy earlier so it can be used in functions.php and admin-ajax.php
What is odd, is I can manually call get_terms (passing a post ID) anywhere else on my page - it only fails when inside my calendar_search() function
Oct
17
comment Register Taxonomy earlier so it can be used in functions.php and admin-ajax.php
Just added the ajax call and the functions that get called. Yes, I include the files, only to keep my functions.php cleaner.
Oct
17
revised Register Taxonomy earlier so it can be used in functions.php and admin-ajax.php
Added more code examples
Oct
17
comment Register Taxonomy earlier so it can be used in functions.php and admin-ajax.php
I have a custom calendar page and an ajax call queries the database (wp_query). I use get_terms inside the custom query, inside my ajax-functions include. How can I show you this code? page-calendar.php > ajax call through admin-ajax.php > custom wp_query > get_terms inside the loop
Oct
17
asked Register Taxonomy earlier so it can be used in functions.php and admin-ajax.php
Oct
17
accepted external wordpress pages using wp-blog-header
Jul
3
awarded  Editor
Jul
3
revised Advanced WP Query and/or
updated with s_ha_dum 's suggestion
Jul
3
comment Advanced WP Query and/or
Thanks - you are correct - I had another function that was taking an array of arrays for an advanced date filter. Still, this doesn't answer the question.
Jul
3
asked Advanced WP Query and/or
May
15
answered Adding an orderby filter, casting postmeta with multiple keys
May
14
asked Adding an orderby filter, casting postmeta with multiple keys
May
8
awarded  Supporter