Skip to content

Instantly share code, notes, and snippets.

@ambercouch
Last active June 26, 2022 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ambercouch/4bab595f674ed06d13dac39b73d0e431 to your computer and use it in GitHub Desktop.
Save ambercouch/4bab595f674ed06d13dac39b73d0e431 to your computer and use it in GitHub Desktop.
Allow access for WordPress editor to the Flamingo CF7 database
<?php
function fl_map_meta_cap($meta_caps){
$meta_caps = array(
'flamingo_edit_contact' => 'delete_pages',
'flamingo_edit_contacts' => 'delete_pages',
'flamingo_delete_contact' => 'delete_pages',
'flamingo_delete_contacts' => 'delete_pages', //May not be a thing???
'flamingo_edit_inbound_message' => 'delete_pages',
'flamingo_edit_inbound_messages' => 'delete_pages',
'flamingo_delete_inbound_message' => 'delete_pages',
'flamingo_delete_inbound_messages' => 'delete_pages',
'flamingo_spam_inbound_message' => 'delete_pages',
'flamingo_unspam_inbound_message' => 'delete_pages');
return $meta_caps;
}
add_filter('flamingo_map_meta_cap', 'fl_map_meta_cap');
@themaniac
Copy link

this snippet will enable all wordpress backend for every registered user...

DO NOT USE !

@kanlukasz
Copy link

@themaniac Could you explain more about that?
If you are a register user, you have basic access to backend always , but without any important permissions. Thats normal

@themaniac
Copy link

@kanlukasz if you use this snippet, users with editor role have the same backend options as administrators...

@lightson
Copy link

That's exactly what I needed, thanks OP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment