set() публичный статический Метод

Options::set('foo', 'newvalue'); Options::set( array( 'foo' => 'bar', 'baz' => 'qux' ) );
public static set ( string | array $name, mixed $value = '' )
$name string | array Name of the option to set or an array of name => value options to set.
$value mixed New value of the option to store. If first parameter is an array, $value is ignored.
Пример #1
0
 /**
  * Setup defaults on activation. Don't overwrite API key if it's already there.
  */
 public function action_plugin_activation()
 {
     Session::notice(_t('Please set your Defensio API Key in the configuration.', 'defensio'));
     if (!Options::get(self::OPTION_API_KEY)) {
         Options::set(self::OPTION_API_KEY, '');
     }
     Options::set(self::OPTION_FLAG_SPAMINESS, 0);
     Options::set(self::OPTION_ANNOUNCE_POSTS, 'yes');
     Options::set(self::OPTION_AUTO_APPROVE, 'no');
 }