Title: [Plugin: Enable Media Replace] creating blank menu item
Last modified: August 20, 2016

---

# [Plugin: Enable Media Replace] creating blank menu item

 *  Resolved [thomask](https://wordpress.org/support/users/thomask/)
 * (@thomask)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-enable-media-replace-creating-blank-menu-item/)
 * Why are you creating blank menu item under /Media?
    /wp-admin/upload.php?page
   =enable-media-replace/enable-media-replace.php
 * [http://wordpress.org/extend/plugins/enable-media-replace/](http://wordpress.org/extend/plugins/enable-media-replace/)

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

 *  [Måns Jonasson](https://wordpress.org/support/users/mungobbq/)
 * (@mungobbq)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-enable-media-replace-creating-blank-menu-item/#post-2802806)
 * Good question. 🙂 It must be legacy. I’ll check it out for next release. Thanks!
 *  [Måns Jonasson](https://wordpress.org/support/users/mungobbq/)
 * (@mungobbq)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-enable-media-replace-creating-blank-menu-item/#post-2802807)
 * I just checked, and actually it’s a workaround. If there is no submenu added,
   WP will not allow me to call upload.php in the plugin directory.
 *  [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-enable-media-replace-creating-blank-menu-item/#post-2802830)
 * Please find a way to remove it though, I’m developing plugins as well and they
   add menus, and because of Media Replace it doesn’t look so neat and nice…
 * That said, I love you plugin, and my plugin (wp-retina-2x) adds an option if 
   your plugin is installed, and shows a recommendation to install it if it isn’t
   🙂
 *  Thread Starter [thomask](https://wordpress.org/support/users/thomask/)
 * (@thomask)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-enable-media-replace-creating-blank-menu-item/#post-2802831)
 * <del>I have found a workaround:
    change capability in add_submenu_page(‘upload.
   php’, __(“Replace media”, “enable-media-replace”), ”,’upload_files’, __FILE__,’
   emr_options’); function to anything what noone has, e.g. “xxx” add_submenu_page(‘
   upload.php’, __(“Replace media”, “enable-media-replace”), ”,’xxx’, __FILE__, ’
   emr_options’); </del> – it works but it than does not show the page after clicking“
   replace media” but anyway i think, there is a better way to access the get parameter,
   e.g. admin_init action, query_vars filter etc.
 *  Thread Starter [thomask](https://wordpress.org/support/users/thomask/)
 * (@thomask)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-enable-media-replace-creating-blank-menu-item/#post-2802832)
 * btw i do not much understand, why do you need it – i’m using attachment_fields_to_save
   and attachment_fields_to_edit filters for simillar function and do not need such
   workaround.
 *  Thread Starter [thomask](https://wordpress.org/support/users/thomask/)
 * (@thomask)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-enable-media-replace-creating-blank-menu-item/#post-2802833)
 * So i have found the solution, now i understand your code, sorry for multiple 
   posts 😉
 * give NULL to parent_slug in ass_submenu_page:
 *  add_submenu_page(NULL, __(“Replace media”, “enable-media-replace”), ”,’upload_files’,
   __FILE__, ’emr_options’);
 *  [Måns Jonasson](https://wordpress.org/support/users/mungobbq/)
 * (@mungobbq)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-enable-media-replace-creating-blank-menu-item/#post-2802869)
 * Thanks, I’ll take a look and implement it in the next release.

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

The topic ‘[Plugin: Enable Media Replace] creating blank menu item’ is closed to
new replies.

 * ![](https://ps.w.org/enable-media-replace/assets/icon-256x256.png?rev=1940728)
 * [Enable Media Replace](https://wordpress.org/plugins/enable-media-replace/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enable-media-replace/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enable-media-replace/)
 * [Active Topics](https://wordpress.org/support/plugin/enable-media-replace/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enable-media-replace/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enable-media-replace/reviews/)

## Tags

 * [menu](https://wordpress.org/support/topic-tag/menu/)

 * 7 replies
 * 3 participants
 * Last reply from: [Måns Jonasson](https://wordpress.org/support/users/mungobbq/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-enable-media-replace-creating-blank-menu-item/#post-2802869)
 * Status: resolved