flamingo_map_meta_cap
filter is available for the purpose.
ok thanks ! can you give me the full hook SVP ?
I have found a hook here :
https://wordpress.org/support/topic/howto-provide-access-to-flamingo-for-non-admin-users/#post-8268712
ckitso solution works fine, do you approved this @takayukister ?
-
This reply was modified 3 years, 10 months ago by
Luc.
-
This reply was modified 3 years, 10 months ago by
Luc.
No. Think about what the filter is there for.
Ok, but how to add the filter ? What solution do you recommend in this case?
I need help too to add the filter
-
This reply was modified 3 years, 10 months ago by
RicardoRVM.
Example:
add_filter( 'flamingo_map_meta_cap', 'yourownprefixhere_flamingo_map_meta_cap' );
function yourownprefixhere_flamingo_map_meta_cap( $meta_caps ) {
$meta_caps = array_merge( $meta_caps, array(
'flamingo_edit_contacts' => 'edit_pages',
'flamingo_edit_inbound_messages' => 'edit_pages',
) );
return $meta_caps;
}
Be aware that user capability settings are a delicate area of security. Don’t think you can use it with a simple copy & paste without a precise understanding what the code does.
@takayukister Thanks we can also add :
add_filter( 'flamingo_map_meta_cap', 'yourownprefixhere_flamingo_map_meta_cap' );
$roleObject = get_role( 'editor' );
just editor will see flamingo