Example #1
0
 function do_install()
 {
     // upgrades
     $this->do_upgrades();
     // installs
     $this->user_roles();
     $this->setup_pages();
     $this->woocommerce_settings();
     $this->create_tables();
     dokan_generate_sync_table();
     flush_rewrite_rules();
     update_option('dokan_theme_version', $this->theme_version);
 }
Example #2
0
 function do_install()
 {
     // upgrades
     $this->do_upgrades();
     // installs
     $this->user_roles();
     $this->setup_pages();
     $this->woocommerce_settings();
     $this->create_tables();
     $this->product_design();
     dokan_generate_sync_table();
     flush_rewrite_rules();
     update_option('dokan_theme_version', DOKAN_PLUGIN_VERSION);
 }
Example #3
0
 /**
  * Update to version 1.2
  *
  * @return void
  */
 public function update_to_12()
 {
     // regenerate sync table for woocommerce 2.2 order status changes
     dokan_generate_sync_table();
 }
Example #4
0
 function tools_page_handler()
 {
     if (isset($_GET['dokan_action']) && current_user_can('manage_options')) {
         $action = $_GET['dokan_action'];
         check_admin_referer('dokan-tools-action');
         switch ($action) {
             case 'dokan_install_pages':
                 $pages = array(array('post_title' => __('Dashboard', 'dokan'), 'slug' => 'dashboard', 'page_id' => 'dashboard', 'content' => '[dokan-dashboard]'), array('post_title' => __('Store List', 'dokan'), 'slug' => 'store-listing', 'page_id' => 'my_orders', 'content' => '[dokan-stores]'));
                 foreach ($pages as $page) {
                     $page_id = wp_insert_post(array('post_title' => $page['post_title'], 'post_name' => $page['slug'], 'post_content' => $page['content'], 'post_status' => 'publish', 'post_type' => 'page', 'comment_status' => 'closed'));
                     if ($page['slug'] == 'dashboard') {
                         update_option('dokan_pages', array('dashboard' => $page_id));
                     }
                 }
                 flush_rewrite_rules();
                 wp_redirect(admin_url('admin.php?page=dokan-tools&msg=page_installed'));
                 exit;
                 break;
             case 'regen_sync_table':
                 dokan_generate_sync_table();
                 wp_redirect(admin_url('admin.php?page=dokan-tools&msg=regenerated'));
                 exit;
                 break;
             default:
                 # code...
                 break;
         }
     }
 }
Example #5
0
 /**
  * Update to version 1.2
  *
  * @return void
  */
 public function update_to_12()
 {
     // regenerate sync table for woocommerce 2.2 order status changes
     dokan_generate_sync_table();
     update_option('dokan_theme_version', '1.2');
 }
<?php

dokan_generate_sync_table();