Support » Plugin: Add Widgets to Page » [Plugin: Add Widgets to Page] Capabilities not wanted: Contributors can delete widgets

  • Resolved ArendB

    (@arendb)


    I had a problem that Contributors with only Read-permissions from User Role Editor can see Widgets-To-Pages and have capabilities to delete Widgets.
    I solved this problem and I hope the plugin gets an update with this.
    So I changed the code with the cursive text, to give the contributors no rights to delete Widgets:
    function addw2p_menu() {
    if ( function_exists(‘add_management_page’) ) {
    add_management_page(“addw2p”, “Widgets to Pages”, ‘manage_options’, __FILE__, ‘addw2p_menu_options’);
    }
    }

    function addw2p_menu_options() {
    if (!current_user_can(‘manage_options’)) {
    wp_die( __(‘You do not have sufficient permissions to access this page.’) );
    }
    echo ‘<div class=”wrap”>’.”\n”;
    echo ‘<h2>Add Widgets to Page</h2>’.”\n”;
    $names = get_option(‘addw2pdn’);

    http://wordpress.org/extend/plugins/add-widgets-to-page/

  • The topic ‘[Plugin: Add Widgets to Page] Capabilities not wanted: Contributors can delete widgets’ is closed to new replies.