Hi Brajesh, I placed your code into the child functions.php and it took the site down.
Hi,
It most probably caused a fatal error due to syntax.Please remove it and post the complete functions.php on https://pastebin.com/
I will update it for you to avoid any syntax issue.
Regards
BrajeshI have fixed the error and have the site up again, but it still doesn’t limit the friends from having a gallery. Everyone still has a gallery link and the galleries dont post to the page designated as the gallery page.
I have just added the code to the pastebin.com site.
How? Sorry, but I am not familiar with it, so do I have to create an account and how do I send it to you?
Is this what you need: https://pastebin.com/YRkJYhrs
You have it correctly there.
I need to check if it works in functions.php or we will need bp-custom.php
Will post back later today.
Hi Patti,
I hope I am not too late.
There was an issue in how I used the s2members function.Here is the updated code
/** * Example: Disable MediaPress gallery for S2 members level 0 * * @param bool $is_active is MediaPress active. * @param string $component component name(members, groups,sitewide etc). * @param int $component_id context items id(user id, group id etc). * * @return bool */ function mpp_custom_disable_for_users( $is_active, $component, $component_id ) { // only for members component. if ( 'members' !== $component ) { return $is_active; } // do not allow zero level to have the gallery. if ( function_exists('current_user_is' ) && current_user_is('s2member_level0' ) ) { return false; } return $is_active; } add_filter( 'mpp_is_enabled', 'mpp_custom_disable_for_users', 10, 3 );
The current_user_is only takes role not the user id. I installed and tested with s2members today.
Hope it helps.
Regards
Brajesh
You must be logged in to reply to this topic.