192 reputation
10
bio website
location
age
visits member for 3 years, 4 months
seen 2 days ago

Jul
22
comment Multisite switch to blog
I nest my switch_to_blog calls and call this at the end. switch_to_blog(1); unset($GLOBALS['_wp_switched_stack']); $GLOBALS['switched'] = false; I found the code somewhere on SE and I haven't been having any problems with this.
Jul
21
comment the_post() within switch_to_blog() altering my excerpt
do you have your code hooked in an action?
Jul
1
comment restore_current_blog() vs switch_to_blog()
@toscho that's what I thought, but I had set a variable higher up on the page called $blog_id = 2 and it messed up my loop and caused get_current_blog_id to return 2 instead of 1 (when I was on 1). I fixed it by changing my $blog_id to $blogID. The only reason I knew to do this was because I used to loop through a list foreach($post as $blog_id => $v) and sending $blog_id into switch_to_blog() doesn't work either.
Jul
1
comment restore_current_blog() vs switch_to_blog()
advice related to this that messes up blog ID..... NEVER call a variable $blog_id or you will mess up everything!
Jun
30
comment Update post meta using save_post hook in multisite
did you ever find a solution? I am having the same problem and have tried many different actions. It's completely ignoring it.
Apr
13
accepted wp_update_term not creating new unique slug
Apr
13
comment wp_update_term not creating new unique slug
So after some testing, it does indeed look like using 'slug' => '' will call upon wp_unique_term_slug. I appreciate the long and thoughtful answer!
Apr
10
comment wp_update_term not creating new unique slug
what if said slug already exists? Does sanitize_title check that? ( aka I would prefer if it adds a 2 ). Also, what would happen if I passed a blank slug in? I will try this when I get a chance, thank you!
Apr
9
asked wp_update_term not creating new unique slug
Feb
6
accepted WP_Query - using category__and when one of the categories is 0
Feb
6
comment WP_Query - using category__and when one of the categories is 0
Wow, thank you.
Feb
5
comment WP_Query - using category__and when one of the categories is 0
Yup, only ever 2. The problem though is $cat could technically be "1,2,3,5,6" so I would need to check it's properties and split into an array. This is sidetracking from the actual issue above though, which your solution does like solve. I feel bad that I may never test it because it currently works, but I know that when updates come I'll have to try this.
Feb
5
comment WP_Query - using category__and when one of the categories is 0
I have two variables I'd have to pass into this - $cat and $cat2. I already wrote the conditional to check the $category value but if I get a chance I'll test this out, and definitely remember in the future. I've never thought about using tax query. thanks!
Feb
4
comment WP_Query - using category__and when one of the categories is 0
@Milo ah, I could create that array before running the query. that does work. good call :)
Feb
4
comment WP_Query - using category__and when one of the categories is 0
@Milo I wrote a post handler that has defaults set to 0. Would it better to have $category = '' as the default?
Feb
4
revised WP_Query - using category__and when one of the categories is 0
added 60 characters in body
Feb
4
asked WP_Query - using category__and when one of the categories is 0
Nov
21
comment disable permalink on custom post type
this didn't work for me - but I had it return '' and it did work. I don't know the implications of that though.
Nov
20
awarded  Popular Question
Oct
14
comment How do I embed youtube videos with https instead of http in the URL?
thank you! ottos no longer works