WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Capability manage_options vs edit_themes (5 posts)

  1. Sayontan Sinha
    Member
    Posted 4 years ago #

    I have a question regarding the capabilities manage_options and edit_themes, particularly in the nature of their differences with respect to the Administrator and the Super Administrator roles in WP-MS.

    In my theme I have these lines:

    add_menu_page("Suffusion", "Suffusion", 'edit_themes', basename(__FILE__), 'suffusion_render_options');
    	add_submenu_page(basename(__FILE__), "Custom Types", "Custom Types", "manage_options", "suffusion-custom-types", 'suffusion_render_custom_types');

    The first line is to configure theme options, while the second is to set up custom post types. When I am logged in as a Super Administrator in WP-MS I see both links in my admin menu. But when I am logged in as an administrator I only see the second link (the one requiring "manage_options" capability) and not the first (requiring "edit_themes").

    Is this expected behavior? Should the administrators not be allowed to set theme options? It doesn't make much sense because for a site within my MS setup I can configure the theme options separately, but only as a Super Administrator, not as an Administrator. The way I see it, there are a few possibilities:
    1. This might be a bug in WP and edit_themes should allow both, Super Admin and Admin
    2. Or I should modify my theme to add the theme options menu for manage_options rather than edit_themes (since all the settings are stored in an option anyway). I am not sure if this is accepted practice, though.
    3. Or there probably exists another capability for multi-site administrators that I am missing.

  2. 1. This might be a bug in WP and edit_themes should allow both, Super Admin and Admin

    Bad idea. When you are running a network, the theme in use is the same single copy on any site you use it on.

    If blog owner 1 edits a theme file, then blog owner 2 edits the same theme file, they'll get overwritten.

    In 3.0 only Super Admins can edit theme, so that capability is tied to them

    For administrators to use options pages tied to that capability, the theme will need updating.

    So yes, expected behaviour.

  3. Sayontan Sinha
    Member
    Posted 4 years ago #

    For administrators to use options pages tied to that capability, the theme will need updating.

    So what you are saying is that option #2 in what I have listed above is acceptable? There are really no theme files to edit in my case, just options in the database.

  4. In my theme I have these lines:

    add_menu_page("Suffusion", "Suffusion", 'edit_themes', basename(__FILE__), 'suffusion_render_options');
    add_submenu_page(basename(__FILE__), "Custom Types", "Custom Types", "manage_options", "suffusion-custom-types", 'suffusion_render_custom_types');

    this is what you posted from your theme. See where it says 'edit_themes' up there? that's what you need to change to manage_options.

    It's not an option in the db.

  5. Sayontan Sinha
    Member
    Posted 4 years ago #

    I understand. That is what I meant by my statement about adding the menu for "manage_options" rather than "edit_themes".

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic