Support » Plugin: Flamingo » Flamigo Roles and Capabilities ?

  • Resolved MarialKa

    (@marialka)


    Hi, thanks to share this plugin

    I’m trying to allow author / editor 😉 to view, edit… address book and messages but needs help

    NB: I use contact form 7

    May be, we need to add something in the wp-config php file, isn’t? but I don’t know what… in fact

    Many thanks in advance

    http://wordpress.org/extend/plugins/flamingo/

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

    (@takayukister)

    No, you can’t change the capability settings in the wp-config.php like Contact Form 7. Instead try adding this code to your theme’s functions.php:

    remove_filter( 'map_meta_cap', 'flamingo_map_meta_cap' );
    add_filter( 'map_meta_cap', 'mycustom_flamingo_map_meta_cap', 9, 4 );
    
    function mycustom_flamingo_map_meta_cap( $caps, $cap, $user_id, $args ) {
        $meta_caps = array(
            'flamingo_edit_contacts' => 'publish_posts',
            'flamingo_edit_contact' => 'publish_posts',
            'flamingo_delete_contact' => 'publish_posts',
            'flamingo_edit_inbound_messages' => 'publish_posts',
            'flamingo_delete_inbound_message' => 'publish_posts',
            'flamingo_delete_inbound_messages' => 'publish_posts',
            'flamingo_spam_inbound_message' => 'publish_posts',
            'flamingo_unspam_inbound_message' => 'publish_posts' );
    
        $caps = array_diff( $caps, array_keys( $meta_caps ) );
    
        if ( isset( $meta_caps[$cap] ) )
            $caps[] = $meta_caps[$cap];
    
        return $caps;
    }

    Perfect 😉 Many thanks for this quick reply

    it’s working with latest version of your plugin, contact form 7 and WP 3.5 for now… in my case

    Really great for my using 😉 thank you

    Hi Takayuki Miyoshi,

    great plugin ! Really useful.

    if I create a role whose only ability is to see his profile,
    how is it possible to allow this role to view and export messages and emails from Flamingo ?

    Do I write the same code as above in functions.php ?
    I don’t understand what represent the parameters 9 and 4 in the function add_filter()…

    Thank you for your answer 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Flamigo Roles and Capabilities ?’ is closed to new replies.