Good question. 🙂 It must be legacy. I’ll check it out for next release. Thanks!
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.
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 🙂
<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.
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.
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’);
Thanks, I’ll take a look and implement it in the next release.