Is there a way to determine the blog id from the post id?
Is there a way to determine the blog id from the post id?
It's not possible because every blog has a post table and every table has a post ID column starts from one. In other words post IDs are not unique.
If you explain more about your need We may find a better way.
Thanks Hassan. I'm trying to get the $blog_name from a $post_id. Any ideas how to do that? Is this just possible w/ the current wpmu schema?
So it looks like for the time being, all I really need is the current site's blog name being posted to. A call to get_option('blogname') returns the blog name.
I'm a bit concerned about the long term implications of post IDs not being unique <sigh>. Moving on ..
Post IDS are not unique because each blog keeps its posts in its own posts table, same as comments.
It does make things harder in some ways and sometimes I cringe when I look at the WPMU DB schema.
Thanks Steve - appreciate the post.
But dont forget that if you've got a post_id then you have to have a blog_id - otherwise WPMU can't get the post or anything associated with it. So if you're in a block of code that has been called then the blog_id is there.
If that makes sense?
Nice. Makes sense.
When I call get_permalink($post->ID), I'm returned the right permalink. Which must mean that get_permalink() is aware of the (current?) blog_id, otherwise it wouldn't be able to return a valid permalink.
Thanks for the schooling :)