Title: Reload Admin Menu Hook
Last modified: November 6, 2023

---

# Reload Admin Menu Hook

 *  Resolved [auditt](https://wordpress.org/support/users/auditt/)
 * (@auditt)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/reload-admin-menu-hook/)
 * Hi there,
 * I’m providing to the backend user some functionalities where admin menu items
   are added or removed based on certain actions. At the moment, I’m reloading the
   entire website after an action is triggered using JavaScript to reflect these
   changes in the admin menu.
 * I was wondering if UIPress provides a specific hook or a function that I could
   use to refresh just the admin menu without having to reload the entire page? 
   Your input is highly appreciated.
 * Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [UiPress](https://wordpress.org/support/users/admintwentytwenty/)
 * (@admintwentytwenty)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/reload-admin-menu-hook/#post-17188340)
 * Hey,
 * This might be possible, are you using the uipress menu creator or just working
   with the default menu?
 * The menu is output as a js variable on each page load so you could in theory 
   replace that variable with your new menu and then fire the custom page load event.
 * It would depend a lot on what exactly you are doing with the menu though.
 * Thanks
 * Mark
 *  Thread Starter [auditt](https://wordpress.org/support/users/auditt/)
 * (@auditt)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/reload-admin-menu-hook/#post-17189224)
 * Hi there,
 * I’m using the default menu.
 * Just to give you a scenario, for my client I wrote a **custom admin page** to
   activate or deactivate some plugins. This is a typical call I do:
 * `activate_plugin($_GET['plugin']); `
 * Let’s say I decide to deactivate woocommerce. In this case, the database is written,
   the plugin is deactivated and the iframe will reload. But the menu stays as it
   is and woocommerce is still visible in the menu.
 * My workaround is to trigger another reload (after iframes reload) per JS:
 * `window.top.location.reload()`
 * Thats why I asked if you have a php hook (or JS) to trigger a dedicated menu 
   reload manually.
 *  Plugin Author [UiPress](https://wordpress.org/support/users/admintwentytwenty/)
 * (@admintwentytwenty)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/reload-admin-menu-hook/#post-17206530)
 * Ok, thanks for clarifying.
 * This will happen automatically if activating / deactivating through the core 
   wordpress page but yes you would need to reload the frame after deactivation 
   for it to refresh the menu.
 * Thanks,
 * Mark

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Reload Admin Menu Hook’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/uipress-lite_88879c.svg)
 * [UiPress lite | Effortless custom dashboards, admin themes and pages](https://wordpress.org/plugins/uipress-lite/)
 * [Support Threads](https://wordpress.org/support/plugin/uipress-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/uipress-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/uipress-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/uipress-lite/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [UiPress](https://wordpress.org/support/users/admintwentytwenty/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/reload-admin-menu-hook/#post-17206530)
 * Status: resolved