$wpdb->prefix returns the main prefix for wp. However, it should return the prefix for sub-blog (when viewing DASHBOARD of sub-blog).

How can i get current blog's table prefix in SUB-BLOG dashboard?
even get_current_blog_id() returns incorrect id.

p.s. I use this functions in admin_init

  • 2
    That doesn't happen normally. Please show us your code. – fuxia Dec 25 '16 at 11:41
  • @toscho, you were right. I have re-checked and found permalinks were messed up and crossing. THANKS! – T.Todua Dec 25 '16 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.