$skip_options = array( 'allowedthemes' ); // Don't update these options since they are handled elsewhere in the form. foreach ( (array) $_POST['option'] as $key => $val ) { $key = wp_unslash( $key ); $val = wp_unslash( $val ); if ( 0 === $key || is_array( $val ) || in_array( $key, $skip_options, true ) ) { continue; // Avoids "0 is a protected WP option and may not be modified" error when editing blog options. } update_option( $key, $val ); }
/** * Fires after the site options are updated. * * @since 3.0.0 * @since 4.4.0 Added `$id` parameter. * * @param int $id The ID of the site being updated. */ do_action( 'wpmu_update_blog_options', $id );
/** * Fires at the end of the Edit Site form, before the submit button. * * @since 3.0.0 * * @param int $id Site ID. */ do_action( 'wpmueditblogaction', $id ); ?> </table> <?php submit_button(); ?> </form>