WordPress.org

Ready to get started?Download WordPress

Forums

Hide certain widget areas in widget menu based on the user's role (1 post)

  1. derek2030
    Member
    Posted 1 year ago #

    What I'm trying to do is hide certain widget areas in the widget menu on the back end based on the user's role. Not hide all widgets, but just certain widget areas.

    I'd like to let the editor mess around with certain widgets, but not others. Some are really important, and include opt-in forms where one change in the opt-in html could break the form. The goal is to connect a couple of empty widget areas to templates, and hide the rest from the editor. That way if the editor wants to put a widget on the sidebar of a page, he could just put a widget in let's say "custom-sidebar-1" from the widget menu, and then assign the post or page to the template "custom-sidebar-1" and he just made his own sidebar.

    I used a plugin called "user role editor" to give widget access to the editor, and then "Adminimize" to take away access to themes and the editor, but now I can't find a way to make specific widget areas disappear for the editor, while leaving others intact.

    I messed around with function wp_unregister_sidebar_widget($id), but I don't really know php. Plus, it looks like that function would only get rid of the widget, and not the widget area.

Topic Closed

This topic has been closed to new replies.

About this Topic