コード例 #1
0
 /**
  * @hook in_admin_header
  */
 public function replace_wp_menu()
 {
     global $menu, $submenu;
     $new_submenu = HW_HOANGWEB::get_wp_option('hw_custom_wp_submenu');
     //get_transient('hw-replace-admin-submenu');
     $new_menu = HW_HOANGWEB::get_wp_option('hw_custom_wp_menu');
     //get_transient('hw-replace-admin-menu');
     if ($new_submenu) {
         $submenu = $new_submenu;
     }
     if ($new_menu) {
         $menu = $new_menu;
     }
 }
コード例 #2
0
 /**
  * get other module submenus
  */
 protected function get_other_module_submenus()
 {
     $module_slug = $this->option('module_name');
     $sub_menus = HW_HOANGWEB::get_wp_option('other_modules_submenus');
     if (isset($sub_menus[$module_slug]['sub']) && is_array($sub_menus[$module_slug]['sub'])) {
         foreach ($sub_menus[$module_slug]['sub'] as &$menu_item) {
             $menu_item = HW_Module_Settings_page::valid_custom_submenu($menu_item);
         }
         return $sub_menus[$module_slug];
     }
 }