0

I have a Wordpress multisite installation and I need and extra field to hold specific ID of every single blog. Wordpress does not allow me to change the ID that is to be created for the blog so I am looking for another solution - custom field. The point is I cannot seem to add one.

What I have tried is:

    switch_to_blog( $blog_id ); 
    $guid = some value I retrieve from somewhere else;
    update_option( 'guid', $guid);
    restore_current_blog();

that ain't doing anything to wp_blogs though.

sis
  • 142
  • 13
  • 1
    IIRC `update_option` writes to `wp123_options` not `wp_blog`. Are you sure it's not getting saved there? – Rup Sep 04 '14 at 12:59
  • U r actually absolutely right! Just checked and wp_options holds the field BUT each separate blog doesn't. But anyway, I'm on the right track! Cheers! – sis Sep 04 '14 at 13:08
  • "each separate blog doesn't" - oh OK: I meant that each blog should have its own separate options table with a different prefix and that the value should go in the right option table for that blog. If it's all ending up in the same wp_options table then I apologise! – Rup Sep 04 '14 at 13:10
  • No, for some reason switch_blog aint working in my code and the data is being recorded in the general wp_options, not wp123_options tables. – sis Sep 04 '14 at 13:13

0 Answers0