• Resolved lrech

    (@lrech)


    Hello,

    Is it possible to show plugin settings page to non Network Admins? To site administrators, for example.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author edward_plainview

    (@edward_plainview)

    It’s currently not possible, but I can add a filter to allow for that if you wish? So you can use a code snippet to selectively allow the menu to be shown.

    Thread Starter lrech

    (@lrech)

    Could be created a capability to that? In this case user role plugins could be used to control the access.

    Plugin Author edward_plainview

    (@edward_plainview)

    If you create the capability yourself, you can modify the snippet to check for the capability and return the correct menu?

    Thread Starter lrech

    (@lrech)

    How can I modify the snippet?

    Plugin Author edward_plainview

    (@edward_plainview)

    First, install the beta version of Broadcast from here

    https://temp.plainview.se/private/7555ff4b/threewp-broadcast-48.15.1671714774.21761.cap.zip

    Then add this snippet:

    add_filter( 'broadcast_menu_target', function( $target )
    {
    	// Show this user the superadmin menu
    	// $target = 'admin_menu_tabs';
    	
    	// Show info about broadcast.
    	// $target = 'broadcast_menu_tabs';
    	
    	// Show no menu at all.
    	// $target = false;
    	
    	return $target;
    } );
    

    Add your capability check in there and you should be able to control what is shown as the menu item.

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

The topic ‘Settings page for administrators’ is closed to new replies.