BuddyDev

Search

[Resolved] bp-force-profile-photo: redirection only for buddypress pages

  • Participant
    Level: Enlightened
    Posts: 126
    Hervé on #11492

    Hello,

    https://buddydev.com/plugins/bp-force-profile-photo/

    This plugin is great 🙂
    I’ve been looking for that for a long time
    Would it be possible to force redirection only for buddypress pages (activities, groups, profile)
    Access to other pages, FAQs or articles is often necessary for a member even without a validated profile (or at least have an option for these other types!)
    Thank you

  • Keymaster
    (BuddyDev Team)
    Posts: 24308
    Brajesh Singh on #11496

    Hi Herve,
    Thank you.

    Yes, it is easily doable. Please see the example at the bottom of the page for an example.
    Should I post a complete solution here?

    Thank you
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 126
    Hervé on #11500

    Hello

    Super 🙂 but I tried this function but it did not work !!
    Anyway, I want the reverse logic (redirection only on all pages buddypress) and authorization on all other pages (potentially dozens, see more with the blog)
    REgards

  • Keymaster
    (BuddyDev Team)
    Posts: 24308
    Brajesh Singh on #11513

    Hi Herve,

    Please put this in your bp-custom.php. The snippet on example was only for mmebres page.

    I am adding this snippet there too.

    
    /**
     * Do not redirect users on non bp pages.
     *
     * @param bool $skip should we skip or redirect.
     *
     * @return bool
     */
    function buddydev_skip_redirect_on_non_bp_pages( $skip ) {
    
    	if ( ! is_buddypress() ) {
    		$skip = true;
    	}
    
    	return $skip;
    }
    
    add_filter( 'bp_force_profile_photo_skip', 'buddydev_skip_redirect_on_non_bp_pages' );
    
    

    Hope that helps.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 126
    Hervé on #11614

    Hi Brajesh
    It works perfectly
    thank you very much

  • Keymaster
    (BuddyDev Team)
    Posts: 24308
    Brajesh Singh on #11619

    Thank you.
    I am glad it worked:)

    Regards
    Brajesh

The topic ‘ [Resolved] bp-force-profile-photo: redirection only for buddypress pages’ is closed to new replies.

This topic is: resolved