New
PeoplePress is here. Community building for WordPress, reimagined. Fast, modern, and built for the communities you've always wanted to run.
See it live

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Hi Scott,
    Thank you for posting.
    I am not sure how to get the information on what page the user was before registration but I will help you with some example snippet that you may extend to work.

    
    /**
     * Filter where to redirect the user after account activation
     *
     * @param string $redirect_url user's profile url
     * @param int $user_id numeric user id
     *
     * @return string
     */
    function buddydev_filter_auto_redirect_url( $redirect_url, $user_id ) {
    
    	// You can filter the redirection based on user
    	// or you can change the $redirect_url to the appropriate value.
    // I suggest using the user_id for filtering approach
    
    	//$redirect_url = wp_get_referer(); //it will not work
    
    	return $redirect_url;
    
    }
    add_filter( 'bpdev_autoactivate_redirect_url', 'buddydev_filter_auto_redirect_url', 10, 2 );
    
    

    You can put this code in your bp-custom.php and modify it to work as per your requirements.

    Hope that helps.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Hi LuXman,
    thank you for asking. It is a simple process consisting of two steps.
    Step 1: – Enable loading of js on the form page
    Please see this line
    https://github.com/sbrajesh/bpdev-username-availability-checker/blob/master/username-availability-checker.php#L169

    You can filter on ‘buddydev_username_availability_checker_load_assets’ and return tru for the page where you want it to be loaded.

    Step 2:- Tell the availability checker about your username field selector.
    Please see this
    https://github.com/sbrajesh/bpdev-username-availability-checker/blob/master/username-availability-checker.php#L130

    That’s all needed.
    Hope that helps.

  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Thank you George. Glad it did 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on in reply to: Plugin Request #8033

    Thank you Carl 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    You are welcome Thank you for confirming Dandy 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Hi George,
    Thank you for asking. It is a very good question.

    yes, It is easily doable.

    here is the code that you can use to display a different page on home page for logged in user

    
    
    /**
     * When a user is logged in, tell WordPress to use 'page' on front page of the site
     * @param string $value
     *
     * @return string
     */
    function buddydev_set_page_as_front_for_loggedin_user( $value ) {
    	if ( is_user_logged_in() ) {
    		$value = 'page';//page is set as front page
    	}
    
    	return $value;
    }
    add_filter( 'pre_option_show_on_front', 'buddydev_set_page_as_front_for_loggedin_user' );
    
    /**
     * For logged in users, set our static page to act as home page
     *
     * @param $value
     *
     * @return int
     */
    function buddydev_set_context_based_page_on_front( $value ) {
    
    	if( ! is_user_logged_in() ) {
    		return $value;
    	}
    
    	//for logged in user, use page id 9
    	return 5;//change with your own page id.
    }
    add_filter( 'pre_option_page_on_front', 'buddydev_set_context_based_page_on_front' );
    
    

    You can change the page_id with your own id.

    Hope that helps.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on in reply to: The stealth mode is only active for one Admin #8030

    Hi,
    You can login as the other user( You can use https://wordpress.org/plugins/user-switching/ for switching user) and set it from their profile settings screen.

    Hope that helps.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on in reply to: Embedding Media in MediaPress #7978

    Hi Xochi,
    I am sorry, it is not yet possible. We will add it this quarter for sure.

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on in reply to: Displaying title and user on shortcode pages #7977

    Hi Xochi,
    I am not sure of the issue. I am going to ask @ravisharma to take a fresh look at this and see if he can help here.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    Brajesh Singh on in reply to: [Resolved] Bp branded login and activation links #7976

    Hi Daniele,
    Thank you for posting.

    You are right, It seems we did not consider the activation as we only considered BuddyPress registration.

    We can add support for custom account activation page or we can let wp-login.php handle it.
    What will be more useful for you ? Please let me know and we can update the plugin.

    Thank you
    Brajesh