public static update_options ( array $array ) | ||
$array | array | array( option name => option value, ... ) |
public static function update_options($array)
{
$names = array_keys($array);
foreach (array_diff($names, self::get_option_names(), self::get_option_names('non_compact'), self::get_option_names('private')) as $unknown_name) {
trigger_error(sprintf('Invalid Jetpack option name: %s', $unknown_name), E_USER_WARNING);
unset($array[$unknown_name]);
}
foreach ($names as $name) {
self::update_option($name, $array[$name]);
}
}
public function setUp() { parent::setUp(); $this->publicize = publicize_init(); $this->fired_publicized_post = false; $this->publicized_post_id = null; $post_id = $this->factory->post->create(array('post_status' => 'draft')); $this->post = get_post($post_id); Jetpack_Options::update_options(array('publicize_connections' => array('not_empty'))); add_action('jetpack_publicize_post', array($this, 'publicized_post'), 10, 1); }