WordPress.org

Ready to get started?Download WordPress

Forums

Enable Media Replace
[resolved] creating blank menu item (8 posts)

  1. thomask
    Member
    Posted 2 years ago #

    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/

  2. Måns Jonasson
    Member
    Plugin Author

    Posted 2 years ago #

    Good question. :) It must be legacy. I'll check it out for next release. Thanks!

  3. Måns Jonasson
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  4. Jordy Meow
    Member
    Posted 2 years ago #

    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 :)

  5. thomask
    Member
    Posted 2 years ago #

    <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.

  6. thomask
    Member
    Posted 2 years ago #

    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.

  7. thomask
    Member
    Posted 2 years ago #

    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');

  8. Måns Jonasson
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks, I'll take a look and implement it in the next release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic