Example #1
0
 /**
  * Install Recipe Hero
  * @todo next DB updater, add to version compare: && null !== $current_db_version )
  */
 public function install()
 {
     $this->create_options();
     // Register post types
     include_once 'class-rh-post-types.php';
     RH_Post_types::register_post_types();
     RH_Post_types::register_taxonomies();
     // Queue upgrades
     $current_version = get_option('recipe_hero_version', null);
     $current_db_version = get_option('recipe_hero_db_version', null);
     if (version_compare($current_db_version, '1.0.0', '<')) {
         update_option('_rh_needs_update', 1);
     } else {
         update_option('recipe_hero_db_version', RecipeHero::$version);
     }
     // Update version
     update_option('recipe_hero_version', RecipeHero::$version);
     // Rating Reminder
     self::install_date();
     // Flush rules after install
     flush_rewrite_rules();
 }