• Resolved davidhefley

    (@davidhefley)


    We are running into an issue with using null as the parent slug and add_submenu_page. On Line 81 of emr-plugin.php, you add the sub menu page to allow for the ?page= GET process, but we use permissions based on the parent slug, so this is generating errors. We have temporarily worked around this issue by editing this file and using upload.php as the parent slug, and then using null as the actual menu title:

      	add_submenu_page('upload.php', esc_html__("Replace media", "enable-media-replace"), null, 'upload_files', 'enable-media-replace/enable-media-replace', array($this, 'route'));
    

    Of course, we had to use some admin side JS to actually remove the “blank” menu item as well. Is there any way to do this without actually editing your core files?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Gerard Blanco

    (@sixaxis)

    Hi @davidhefley,

    Do you use any permissions plugin/manager? Or how do you exactly manage the permissions?

    Thank you,

    Thread Starter davidhefley

    (@davidhefley)

    Yes – we use PressPermit Pro for permissions.

    Plugin Support Gerard Blanco

    (@sixaxis)

    Good morning @davidhefley,

    Thank you. I’ve reported it to our developers and they will take a look at this as soon as we can.

    Cheers!

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi there,

    We’ve discussed this issue internally, and our developers have taken a look at how to tackle this.

    First, this is what we’ve found:
    – Using upload.php in the add_submenu_page it will display in the submenu that we don’t need
    – Using your proposed solution it will still display in the submenu page, but leaving an empty line.

    We didn’t find any other way to exclude it from the menu with the same functionality. Also, this seems for many cases to be the accepted solution in WordPress.

    Possible fixes:
    – You could ask the author of PressPermit to add a feature allowed for these kind of cases
    – You can add a mu-plugin which will unload the menu hook and add the preferred menu hook. This can be done by hooking into the admin_menu hook after EMR added the submenu page, and do remove_submenu_page and re-add it differently.

    Let me know please if you have any questions.

    Best,

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

The topic ‘Permissions Issue’ is closed to new replies.