Omar ElHawary
Forum Replies Created
-
Hi @mahofer,
Since Avada is a paid theme, and I don’t have access to it. I recommend checking with theme support to determine what captivity is required to allow users to access and import containers.
Regards,
Hi @mahofer,
Thanks for reaching out Members Support Team!
May I ask which page builder you’re using so I can try to replicate the issue from my end?
Regards,
Hi @bangkokaccueil,
Thanks for reaching out Members Support Team!
Please navigate to WP Dashboard > Members > Roles and share a screenshot for this page so we can check how many Granted capabilities for both roles. Also, may I ask what the issue is that Colened role can’t access?
Regards,
Hi @shamrock82,
Thanks for reaching out Memebrs Support Team!
I recommend checking Admin Menu Editor plugin to acheve what are you looking for.
Regards,
Great to hear everything is running smoothly! If you ever have questions, feel free to open a ticket. Your insights are invaluable to us, and we appreciate it if you ever want to share.
Keep having a fantastic day!
Hi @handmadehome,
Thanks for reaching out Members Support Team!
Please copy/paste PHP snippet below WP Code plugin or theme functions.php to use [members_user_role] shortcode to display user roles.
function display_members_user_role() {
if (is_user_logged_in()) {
$current_user = wp_get_current_user();
$roles = $current_user->roles;
return !empty($roles) ? esc_html(implode(', ', $roles)) : 'No roles assigned';
} else {
return 'User not logged in';
}
}
add_shortcode('members_user_role', 'display_members_user_role');For display images/content based on user role? I recommend checking Shortcodes.
Regards,
Hi @deepmessage,
Thanks for reaching out Members Support Team!
Please copy/paste PHP snippet below WP Code plugin or theme functions.php and let me know if it helps.
function exclude_protected_from_search($query) {
if ($query->is_search && !is_admin()) {
$meta_query = array(
array(
'key' => '_members_access_role',
'compare' => 'NOT EXISTS',
),
);
$query->set('meta_query', $meta_query);
}
return $query;
}
add_filter('pre_get_posts', 'exclude_protected_from_search');Regards,
Hi @matthewdhuntley,
You should uncheck it and then click Update button and it will removed as in this screen recording.
Regards,
Hi @flamuren,
Thanks for reaching out Members Support Team!
I believe that we can’t do that as Login page is already protected because Enable Private Site option.
Regards,
Hi @hqueen,
Thanks for reaching out Members Support Team!
I tried to check and everything looks great for me as in this screenshot. So, am I missing something?
Regards,
Forum: Plugins
In reply to: [Members - Membership & User Role Editor Plugin] Uncheck/Reset in bulkHi @theotherdavid,
Thanks for reaching out Members Support Team!
Please copy/paste PHP snippet below to theme functions.php file and let me know if it helps:
function reset_members_access_role_permissions() {
// Query all posts that have the _members_access_role meta key
$args = array(
'post_type' => 'any', // If you only want specific post types, adjust this
'meta_key' => '_members_access_role',
'posts_per_page' => -1
);
$posts = get_posts($args);
foreach ($posts as $post) {
// Delete the _members_access_role meta key for each post
delete_post_meta($post->ID, '_members_access_role');
}
}
// Uncomment the line below to run the function once, and then comment it out after it's done
//reset_members_access_role_permissions();Regards,
Forum: Plugins
In reply to: [Members - Membership & User Role Editor Plugin] Wrong Role sent to WebhookHi @mikejandreau,
I checked things with dev team and kindly find the reply below:
I investigated this issue from Members and I believe that the cause of this is the hook priority. We’re using the?
profile_update
?action hook with the default priority set to 10 to add or remove roles. This hook accepts?$user_id
?and?$old_user_data
?arguments where?$old_user_data
?is WP_User object. If the webhook listens to this action and uses default priority 10 or more, the roles in the?$old_user_data
?object will run after Members update the user role, which would be the new roles the user updates. To get old roles before Members update user roles, you must use a priority lower than 10.The?
$old_user_data
?is user object so if you fetch user data after our code runs you will get updated data with new role. When I used the hook like this:?add_action('profile_update', 'custom_func', 9, 2)
?I received old role for user, but when I used this hook:?add_action('profile_update', 'custom_func', 10, 2)
?with higher priority, it returned new role.Regards,
Forum: Plugins
In reply to: [Members - Membership & User Role Editor Plugin] Edit no permissions pageHi @wiredpinecone,
Thanks for reaching out Members Support Team!
Please navigate to WP Dashboard > Members > Settings > Error Message as in this screenshot.
Regards,
Hi @sriva,
I can’t provide any help in this matter as it paid plugin and we can’t test it to troubleshooting.
Regards,