static function set( array $options ) {

        if ( is_array( $options ) ) {

            // Force mentioned options with filters
            foreach ( $options as $must_use_option => $must_use_value ) {

                // Always return this value for the option
                add_filter( "pre_option_{$must_use_option}", function() use ( $must_use_value ) {
                    return $must_use_value;
                });

                // Always deny saving this value to the DB
                // wp-includes/option.php:280-291 stops updating this option if it's same
                add_filter( "pre_update_option_{$must_use_option}", function() use ( $must_use_value ) {
                    return $must_use_value;
                });
            }

            // Add to all options which can be used later on in admin_footer hook
            self::add_options( $options );
        }
    }
static function set( array $options ) {

        if ( is_array( $options ) ) {

            // Force mentioned options with filters
            foreach ( $options as $must_use_option => $must_use_value ) {

                // Always return this value for the option
                add_filter( "pre_option_{$must_use_option}", function() use ( $must_use_value ) {
                    return $must_use_value;
                });

                // Always deny saving this value to the DB
                // wp-includes/option.php:280-291 stops updating this option if it's same
                add_filter( "pre_update_option_{$must_use_option}", function() use ( $must_use_value ) {
                    return $must_use_value;
                });
            }

            // Add to all options which can be used later on in admin_footer hook
            self::add_options( $options );
        }
    }
static function set ( array $ options ) { if ( is_array ( $ options ) ) { // Force mentioned options with filters foreach ( $ options as $ must_use_option => $ must_use_value ) { // Always return this value for the option add_filter ( "pre_option_{$must_use_option}" , function ( ) use ( $ must_use_value ) { return $ must_use_value ; } ) ; // Always deny saving this value to the DB // wp-includes/option.php:280-291 stops updating this option if it's same add_filter ( "pre_update_option_{$must_use_option}" , function ( ) use ( $ must_use_value ) { return $ must_use_value ; } ) ; } // Add to all options which can be used later on in admin_footer hook self :: add_options ( $ options ) ; } }
Forces options from WP_READONLY_OPTIONS array to be predetermined
This is useful if some plugin doesn't allow defining options in wp-config.php

@param $options array - List of forced options
Forces options from WP_READONLY_OPTIONS array to be predetermined This is useful if some plugin doesn t allow defining options in wp - config . php