• Resolved technologyrocks

    (@technologyrocks)


    Hi

    I am using Contact form 7 and the associated Flamingo plugin.

    Contact form 7 shows as a capability under Contact Forms.
    The Flamingo plugin does not show anywhere

    Is there anything I need to up to make Flamingo show so I can assign it to a role? I have searched the FAQ and contacted the Flamingo developer and he sent me here….

    thanks very much

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Caseproof

    (@caseproof)

    Hi @technologyrocks

    Here’s the code that allows you to add Group to Members:

    add_action( 'members_register_cap_groups', 'th_register_cap_groups' );
    
    function th_register_cap_groups() {
    
    	members_register_cap_group(
    		'your_group_name',
    		array(
    			'label'    => __( 'Your Group Label', 'example-textdomain' ),
    			'caps'     => array(),
    			'icon'     => 'dashicons-admin-generic',
    			'priority' => 10
    		)
    	);
    }

    and here is the code to add custom capabilities:

    add_action( 'members_register_caps', 'th_register_caps' );
    
    function th_register_caps() {
    
    	members_register_cap(
    		'your_cap_name',
    		array(
    			'label' => __( 'Your Capability Label', 'example-textdomain' ),
    			'group' => 'example'
    		)
    	);
    }

    however, implementing this capability will require custom coding.

    Cheers

    Thread Starter technologyrocks

    (@technologyrocks)

    Fabulous, thank you!

    Thread Starter technologyrocks

    (@technologyrocks)

    Hi, for anyone else who needs this, I found that Flamingo is assigned the edit_users capability.

    In Members, grant edit_users in the custom role and hey presto! Flamingo shows in the custom role (and no user menu if Edit Users is the only capability granted).

    This opens up a security hole, as this custom role should not have access to users. Therefore, I also added the following to my functions.php, where ‘cattery-admin’ is the name of the custom role:

    
    add_action( 'load-user-edit.php', 'post_listing_page' );
    function post_listing_page() {
    	$user = wp_get_current_user();
    	if ( $user->roles[0] == 'cattery_admin' ) {
    	    wp_redirect( site_url('/'));
    	    exit;
    	}
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Flamingo Plugin not showing’ is closed to new replies.