コード例 #1
0
 public function test_update_only_runs_once()
 {
     Tribe__Events__Main::instance()->setOption('schema-version', 0);
     remove_action('wp_loaded', 'flush_rewrite_rules');
     $this->assertFalse(has_action('wp_loaded', 'flush_rewrite_rules'));
     $updater = new Tribe__Events__Updater('3.10a0');
     $updater->do_updates();
     $this->assertNotEmpty(has_action('wp_loaded', 'flush_rewrite_rules'));
     remove_action('wp_loaded', 'flush_rewrite_rules');
     if ($updater->update_required()) {
         $updater->do_updates();
     }
     $this->assertFalse(has_action('wp_loaded', 'flush_rewrite_rules'));
 }
コード例 #2
0
ファイル: Main.php プロジェクト: kevinaxu/99boulders
 public function run_updates()
 {
     $updater = new Tribe__Events__Updater(self::VERSION);
     if ($updater->update_required()) {
         $updater->do_updates();
     }
 }
コード例 #3
0
ファイル: Deactivation.php プロジェクト: TMBR/johnjohn
 /**
  * Set a flag to indicate that the plugin has been deactivated
  * and needs to be reinitialized if it is reactivated
  *
  * @return void
  */
 private function set_flags()
 {
     require_once dirname(__FILE__) . '/Updater.php';
     $updater = new Tribe__Events__Updater(Tribe__Events__Main::VERSION);
     $updater->reset();
 }