Replies
- Brajesh Singh on July 26, 2018 at 2:58 pm in reply to: Mediapress uploader shortcode – Uploading Temporarily disabled? #16517
Hi George,
The problem is component.Please use
[mpp-uploader gallery_id=2581 component=sitewide]That will fix it.
Let me know if it works or not?
Regards
Brajesh - Brajesh Singh on July 26, 2018 at 2:50 pm in reply to: [Resolved] Hide a specific post category in the activities #16515
You are welcome 🙂
You are welcome. Glad that it worked 🙂
Thank you Oscar.
Please link me to the image. It’s strange. If we can reproduce it, I can certainly fix it.
Hi Oscar,
I have asked @ravisharma to look into it and assist you. He will help you further.- Brajesh Singh on July 26, 2018 at 12:02 am in reply to: [Resolved] Xprofile show age in "members-loop" #16500
You are welcome.
- Brajesh Singh on July 26, 2018 at 12:02 am in reply to: Creating galleries only to role admin #16499
Hi Antonio,
In that case, we will need to first create a function to test for role like this/** * Check if a user has given WordPress role. * * @param int $user_id user. * @param string $role role. * * @return bool */ function buddydev_user_has_role( $user_id, $role ) { $user = get_user_by( 'id', $user_id ); if ( empty( $user ) ) { return false; } $user_roles = $user->roles; if ( empty( $user_roles ) ) { return false; } return in_array( $role, $user_roles, true ); }And then, we can use it like below(I am only enabling for administrator in this case)
/** * Only allow galleries for a certain role. * * @param bool $is_active Can create gallery or not. * @param string $component Component name. * @param int $component_id Component id. * * @return bool */ function buddydev_enable_gallery_for_role_only( $is_active, $component, $component_id ) { if ( 'members' == $component ) { $is_active = buddydev_user_has_role( $component_id, 'administrator' ); // 'editor', 'contributor', 'subscriber' } return $is_active; } add_filter( 'mpp_is_enabled', 'buddydev_enable_gallery_for_role_only', 10, 3 );That will do it for you.
Regards
Brajesh - Brajesh Singh on July 25, 2018 at 11:54 pm in reply to: How add new type notification for BuddyPress? #16498
Hi Max,
Welcome to BuddyDev.You can use
bp_notifications_add_notification();to add new type of notifications. Please do note that you will need to register a dummy component and notification callback to make it render the notification.
From your post, It seems you are using some kind of task management plugin. My suggestion will be to ask the developer to add it. It should be a very simple task as they might have some of the notifications already there.
Regards
Brajesh Hi Audiomonk,
You can use
get_edit_profile_url( $user_id)to get the profile edit link.
In your case, you can use the following code
echo "<li><a href='" . get_edit_profile_url( get_current_user_id() ) . "'>" . __( 'Edit my profile', 'clean-login' ) . "</a></li>";Regards
Brajesh- Brajesh Singh on July 25, 2018 at 2:08 pm in reply to: Mediapress uploader shortcode – Uploading Temporarily disabled? #16492
Hi George,
Will it be feasible for you to share the temporary login details with me.It is very strange that the shortcode is behaving this way.