WordPress.org

Forums

[resolved] Removing "export" from my users admin panel (8 posts)

  1. Amal 007
    Member
    Posted 1 year ago #

    Hi,

    Is there a way could remove/hide "Export" option from my users admin panels.Am sorry for the dumb question :) thanks in advance.

  2. indybook
    Member
    Posted 1 year ago #

    function hide_export_from_non_admins() {
            if ( ! current_user_can( 'install_themes' ) ) {
                 remove_submenu_page('tools.php', 'export.php');
            }
     }
     add_action( 'admin_menu', 'hide_export_from_non_admins' );

    Add this to your theme function.php

  3. Amal 007
    Member
    Posted 1 year ago #

    Thanks for your reply indybook.
    Sorry if am wrong...i guess this is applicable only to the users use who use same theme which is used by super admin right? but my users have option to choose from several themes...

  4. Don't put it in your theme function.php (indybrook, it's a great idea, but not sustainable).

    Instead, put it in an mu-plugin file!

    Read http://halfelf.org/2012/mu-plugins-are-good/ for some examples :)

  5. indybook
    Member
    Posted 12 months ago #

    Amal 007, you are right about the theme function file. It's a mu forum, my bad. should be mu-plugin file, of course, as Ipstenu (Mika Epstein) says.

  6. You can use mu-plugins on a single install of WP :) I use 'em on clients where I don't want them to disable plugins :)

  7. indybook
    Member
    Posted 12 months ago #

    Ipstenu (Mika Epstein), it's a good one, thanks! I never gave it much thought with singles, as the owners usually want a theme per a site. will try it definitely. Is productivity ok with it? Theoretically it should be

  8. Amal 007
    Member
    Posted 12 months ago #

    Hi Indybook and Ipstenu (Mika Epstein) thankyou for your responses...i created the mu-plugin and it works fine:) thanks!!

Topic Closed

This topic has been closed to new replies.

About this Topic