Skip to content

Commit

Permalink
Fix multisite settings for WP 5.5+
Browse files Browse the repository at this point in the history
  • Loading branch information
jfarthing84 committed Sep 3, 2020
1 parent 473bb40 commit 805ef6e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/admin/settings.php
Expand Up @@ -583,19 +583,22 @@ function tml_admin_save_ms_settings() {
return;
}

/* This filter is documented in wp-admin/options.php */
/** This filter is documented in wp-admin/options.php */
$whitelist_options = apply_filters( 'whitelist_options', array() );

if ( ! isset( $whitelist_options[ $option_page ] ) ) {
/* This filter is documented in wp-admin/options.php */
$allowed_options = apply_filters( 'allowed_options', $whitelist_options );

if ( ! isset( $allowed_options[ $option_page ] ) ) {
wp_die(
sprintf(
__( '<strong>Error</strong>: Options page %s not found in the options whitelist.' ),
'<code>' . esc_html( $options_page ) . '</code>'
'<code>' . esc_html( $option_page ) . '</code>'
)
);
}

foreach ( $whitelist_options[ $option_page ] as $option ) {
foreach ( $allowed_options[ $option_page ] as $option ) {
$option = trim( $option );
$value = null;
if ( isset( $_POST[ $option ] ) ) {
Expand Down

0 comments on commit 805ef6e

Please sign in to comment.