admin_option = $st_instance->get_admin_option( $option_name ); } /** * @param string $old_value * @param string $new_value * * @return mixed */ public function pre_update_filter( $old_value, $new_value ) { $wp_api = $this->sitepress->get_wp_api(); if ( $wp_api->is_multisite() && $wp_api->ms_is_switched() && ! $this->sitepress->get_setting( 'setup_complete' ) ) { throw new RuntimeException( 'You cannot update blog option translations while switched to a blog on which the WPML setup is not complete! You are currently using blog ID:' . $this->sitepress->get_wp_api()->get_current_blog_id() ); } WPML_Config::load_config_run(); return $this->admin_option->update_option( '', $new_value, ICL_TM_COMPLETE ) ? $old_value : $new_value; } }