Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25323
    Brajesh Singh on in reply to: [Resolved] BP Contact Form Issue enable/disable #20042

    No problem.

    Thank you for confirming that it works.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25323

    Hi Greg,
    For now, Please remove both the snippet. It seems confusing.

    I am putting a role based snippet where you can map role to duration/count directly.

    In the above code, we are not using role, we are using capabilities to decide what to allow for user. That’s why you are seeing user_can.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25323
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25323
    Brajesh Singh on in reply to: [Resolved] BP Contact Form Issue enable/disable #20033

    Hi Daniel,
    I have pushed the update now.

    In version 1.0.7, you can set the default visibility for the form. It only works if user is allowed to toggle the contact form visibility on their profile.

    https://buddydev.com/plugins/buddypress-user-contact-form/

    Hope that helps.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25323

    Hi Richard,
    Thank you.
    No problem with the delay. I am looking forward to your feedback.

    Best regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25323
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25323

    Hi Carsten,
    In both the filters, we pass user id. So, It will be simple to check user role.

    Are you using WooCommerce’s customer role? I can provide a snippet for you .

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25323

    Hi Richard,
    Please put the following code in your bp-custom.php

    
    
    /**
     * Redirect to login page on accessing single media for non logged.
     */
    function mpp_custom_single_media_access_restriction() {
    
    	if ( ! function_exists( 'mpp_is_single_media' ) || ! mpp_is_single_media() || is_user_logged_in() ) {
    		return;
    	}
    	// Redirect to login page.
    	bp_core_redirect( wp_login_url() );
    }
    
    add_action( 'bp_template_redirect', 'mpp_custom_single_media_access_restriction' );
    
    /**
     * Do not load lightbox for non logged users.
     *
     * @param array $settings settings.
     *
     * @return array
     */
    function mpp_custom_filter_lightbox_options( $settings ) {
    
    	if ( ! did_action( 'init' ) || is_user_logged_in() ) {
    		return $settings;
    	}
    
    	// if we are here, user is not logged and it is after init action.
    
    	$settings['load_lightbox'] = 0;
    
    	return $settings;
    }
    add_filter( 'mpp_settings', 'mpp_custom_filter_lightbox_options' );
    

    Currently, we don’t have filter for individual option, so we had to filter the settings array. In future, I will add a way to filter individual option too.

    Please do let me know if the code works for you or not?

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25323

    Hi BIN,
    Thank you for the patience.

    I have updated the plugin. Please upgrade to 1.3.0 from here
    https://buddydev.com/plugins/blog-categories-for-groups/

    1. User must select category on create screen :- Now it is enforced. The users are required to select terms.

    2. Do not let Blog admins disable blog: – Please visit Dashboard->Settings->Blog Categories for Groups and for the option “Allow group admin to disable blog tab?” set “No”.

    4. Now all articles published by different group admin but who join the same directory are listed together. :- Fixed. It will only list articles from current group now.

    5. You can disable this behaviour now. For the option “Disable group blog post edit link leading to dashboard?” . Set it to “Yes”.

    Hope that helps.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25323

    Hi,

    Thank you for the patience.

    Please upgrade to 1.3.0 and then you can visit Dashboard->Settings->Blog Categories for Group and for the setting

    “How do we link to single posts?”, Please select “Link to normal site blog post page.” That will do it.

    Regards
    Brajesh