update_blog_option()
I was dealing with network DB option filtering few weeks back and I was unable to find a proper way to use update_option, update_site_option or any relevant function to update the main site's option value. I just found update_blog_option which is pretty cool and it does the following inside: [php] ... switch_to_blog( $id ); $return = update_option( $option, $value ); restore_current_blog(); ... [/php] Since the option filtering is triggered per update option, I had to hack it with recursively switching the blog and resetting it after the second callback: [php] public function get_network_trzapi_key( $option ) { $site_id = get_current_blog_id(); if… Continue Reading