/** * reset all caches created by hoangweb plugin */ public static function reset_wp_menus_caches() { static $reset; if (!$reset && class_exists('HW_Module_Config_general')) { $config = HW_Module_Config_general::get_module_configs('config'); $config->refresh_wp_menus_cache(false); $reset = 1; } }
$this->command_log('deleted all menus caches !'); } } /** * build & save custom wp menus */ public function save_custom_wp_menus() { //refresh cache for first $this->refresh_wp_menus_cache(); $submenu = HW_SESSION::get_session('submenu'); $menu = HW_SESSION::get_session('menu'); #HW_Modules_Manager::build_modules_wp_menu(); if ($menu) { HW_HOANGWEB::add_wp_option('hw_custom_wp_menu', $menu); } if ($submenu) { HW_HOANGWEB::add_wp_option('hw_custom_wp_submenu', $submenu); } //remove sessions HW_SESSION::del_session('submenu', 'menu'); $this->command_log('Build & Save custom wp menus !'); } public function test() { $this->save_custom_wp_menus(); echo 'sddhfgh46'; } } HW_Module_Config_general::register_config_page();