WordPress MU: get the ID of the current blog

Here are three ways to retrieve the ' ID of the current blog.

Via the global $blog_id

1
; echo $ blog_id;

Through the global object $current_blog

1
-> blog_id ; echo $ current_blog -> blog_id;

Through the global object $wpdbg

1
-> blogid ; echo $ wpdb -> blogid;

One Response to "WordPress MU: get the ID of the current blog"

  1. May 20, 2010 Tweets that mention Wordpress MU: get the ID of the current blog | Undolog.com - Topsy.com :

    [...] This post was Mentioned on Twitter by acidcrash, Giovambattista Fazio. Giovambattista Fazio said: WordPress MU: get the ID of the current blog: Here are three ways to retrieve the ID of the blog ... http://goo.gl/fb/cllVA [...]

Leave a comment

TAG XHTML PERMITS: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> INSERTION CODE:
 <pre></pre> // blocco generico <code></code> // blocco generico [cc_actionscript][/cc_actionscript] // Actionscript [cc_actionscript3][/cc_actionscript3] // Actionscript 3 [cc_css][/cc_css] // CSS Style Sheet [cc_html][/cc_html] // HTML [cc_js][/cc_js] // Javascript [cc_objc][/cc_objc] // Objective-C [cc_php][/cc_objc] // PHP [cc_sql][/cc_sql] // SQL 


Stop SOPA