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
183786
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 );
        }
    }
1356018
public function setOptions(array $options = null): void
    {
        // store options by default
        $this->options = (array)$options;

        // apply options
        foreach ($this->options as $key => $value) {
            $this->setOption($key, $value);
        }
    }
828503
protected function _setOptions($options)
    {
        if (empty($options)) {
            $options = [];
        }

        $url = $this->get('url');
        if (!is_array($url)) {
            $isHttp = substr($url, 0, 7) === 'http://';
            $isHttps = substr($url, 0, 8) === 'https://';
            if ($isHttp || $isHttps) {
                $options += ['target' => '_blank'];
            }
        }

        return $options;
    }
118408
static public function setOptions($options = [])
    {
        if (isset($options['gzip'])) {
            self::$optGzip = !empty($options['gzip']);
        }
        if (isset($options['minimal'])) {
            self::$optMinimal = !empty($options['minimal']);
        }
    }
616042
private function readOptions(array $readOptions)
    {
        if (isset($readOptions['readConsistency'])) {
            switch ($readOptions['readConsistency']) {
                case 'STRONG':
                    $readOptions['readConsistency'] = ReadConsistency::STRONG;
                    break;

                case 'EVENTUAL':
                    $readOptions['readConsistency'] = ReadConsistency::EVENTUAL;
                    break;

                default:
                    //@codeCoverageIgnoreStart
                    throw new \InvalidArgumentException('Invalid value for Read Consistency.');
                    break;
                    //@codeCoverageIgnoreEnd
            }
        }

        return $this->serializer->decodeMessage(
            new ReadOptions,
            $readOptions
        );
    }
457723
public function setOptions($options) {
    $result = true;
    foreach($options as $option => $value) {
      $result |= $this->setOption($option, $value);
    }
    return $result;
  }
107497
public function setOptions($options)
    {
        $format = null;

        /** @noinspection UnSafeIsSetOverArrayInspection */
        if (isset($options['date_format'])) {
            $format = $options['date_format'];

            unset($options['date_format']);
        } /** @noinspection UnSafeIsSetOverArrayInspection */ elseif (isset($options['format'])) {
            $format = $options['format'];

            unset($options['format']);
        }

        if ($format) {
            $options['format'] = $format;
        }

        parent::setOptions($options);

        return $this;
    }
1071404
public function options(array $options = null)
    {
        if (null === $options) {
            return $this->options;
        }

        $this->options = [];
        foreach($options as $option)
            $this->options[$option] = false;

        return $this;
    }
254810
protected function setOptions(array $options = []): void
    {
        $this->options = $options;
        $this->configName = empty($options['cacheConfig']) ? static::DEFAULT_CONFIG : (string)$options['cacheConfig'];
        $this->skipCache = empty($this->options['cacheSkip']) ? false : (bool)$this->options['cacheSkip'];
    }
266230
protected function setOptions(array $options)
    {
        $this->options = [];

        foreach ($options as $option => $value) {

            if (!in_array($option, (array)$this->availableOptions)) {
                throw new \InvalidArgumentException(
                    sprintf('filter %s has no option "%s"', get_class($this), $option)
                );
            }

            $this->options[$option] = $value;
        }
    }
1264188
protected function handleOptions(array &$options = [])
    {
        parent::handleOptions($options);
        if (isset($options['reason_phrase'])) {
            $this->reasonPhrase = $options['reason_phrase'];
        }
    }
341066
protected function setOptions($options)
    {
        foreach (array('directory', 'path', 'ignore', 'allowed_errors') as $key) {
            if (array_key_exists($key, $options)) {
                $this->{$key} = $options[$key];
            }
        }
    }
25390
public function set_option($options = array()) {
        if (!empty($options['apikey'])) {
            set_config('apikey', trim($options['apikey']), 'youtube');
        }
        unset($options['apikey']);
        return parent::set_option($options);
    }
679922
public function setOptions($options)
    {
        if ($options instanceof Traversable) {
            $options = ArrayUtils::iteratorToArray($options);
        }

        // Set plugin manager
        if (array_key_exists('pluginManager', $options)) {
            if (is_scalar($options['pluginManager']) && class_exists($options['pluginManager'])) {
                $options['pluginManager'] = new $options['pluginManager'];
            }
            $this->setPluginManager($options['pluginManager']);
        }

        if (array_key_exists('throwTargetExceptionsOn', $options)) {
            $this->setThrowTargetExceptionsOn($options['throwTargetExceptionsOn']);
        }

        if (array_key_exists('targetReplacementIdentifier', $options)) {
            $this->setTargetReplacementIdentifier($options['targetReplacementIdentifier']);
        }

        if (array_key_exists('target', $options)) {
            $this->setTarget($options['target']);
        }

        if (array_key_exists('rules', $options)) {
            $this->addRules($options['rules']);
        }

        return $this;
    }
530146
public function set_option($options = array()) {
        $options['issuerid'] = clean_param($options['issuerid'], PARAM_INT);
        $options['controlledlinkfoldername'] = clean_param($options['controlledlinkfoldername'], PARAM_TEXT);

        $ret = parent::set_option($options);
        return $ret;
    }
1040675
protected function set_choices() {
		if ( ! is_array( $this->choices ) ) {
			$this->choices = [];
		}

		$this->choices = wp_parse_args(
			$this->choices,
			[
				'on'    => esc_html__( 'On', 'kirki' ),
				'off'   => esc_html__( 'Off', 'kirki' ),
				'round' => false,
			]
		);
	}
585793
public function setOptions(array $options)
    {
        if ($this->options && is_array($options)) {
            $options = ArrayUtils::merge($this->options, $options);
        }

        $this->options = $options;

        return $this;
    }