BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: buddypress member list hide #15514

    Hello nopipe,

    Thank you for posting. It can be easily doable. I have some questions

    1. Are you looking for a way to hide members directory page?.
    2. For which criteria you want to hide members. like for non-loggedin users or any special type of user.

    Please let me know.

    Thank you
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] BuddyPress Xprofile Custom Field Types Age #15467

    Thank you for the acknowledgement.

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Creating a membership type selection on Registration #15466

    Hello Bo,

    Thank you for the kind words. Yes, Member types pro is a plugin that allows defining member types that can be used as field either select box or radio type on the signup form. For showing other fields based on member types please use “Conditional profile field” plugin to load other fields conditionally based on selected member type. Hope it might help you.

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Keith,

    Thank you for posting. Please try the following code in your bp-custom.php file and let me know if it works or not.

    
    /**
     * Modify birth date output
     *
     * @param string $age Age.
     * @param int    $field_id Field id.
     *
     * @return array
     */
    function buddydev_modify_birth_date_data( $age, $field_id ) {
    
    	if ( ! bp_is_user() || ! bp_xprofile_get_meta( $field_id, 'field', 'show_age', true ) ) {
    		return $age;
    	}
    
    	if ( strpos( $age, ',' ) != false ) {
    		$age = explode( ',', $age );
    
    		return $age[0];
    	};
    
    	return $age;
    }
    add_filter( 'bpxcftr_birthdate_age_display_data', 'buddydev_modify_birth_date_data', 10, 2 );
    
    

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Brendan,

    Please check the following example code. it might help you.

    
    /**
     * Register a custom Form
     *
     */
    function my_post_form() {
    
    	$settings = array(
    		'post_type'             => 'book', // Replace it with your custom post type.
    		// Which post type.
    		'post_author'           => bp_loggedin_user_id(),
    		// Who will be the author of the submitted post.
    		'post_status'           => 'publish',
    		// How the post should be saved, change it to 'publish' if you want to make the post published automatically.
    		'current_user_can_post' => is_user_logged_in(),
    		// Who can post.
    		'show_categories'       => true,
    		// Whether to show categories list or not, make sure to keep it true.
    		'tax' => array(
    			'category' => array(
    				'taxonomy'  => 'category',
    				'view_type' => 'checkbox',
    				'include' => array( 1, 31 ), // Replace categories ids you want to show.
    			),
    		),
    	);
    
    	bp_new_simple_blog_post_form( 'my form', $settings );
    }
    
    add_action( 'bp_init', 'my_post_form', 4 );
    

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Remove All Members Option #15429

    Hello Sujee,

    Please try following code in your “bp-custom.php” file. This code will make none logged in users to redirect back to the URL they come from. The code will redirect only when they will try to access members directory. Please check and let me know if it meets your requirement or not.

    
    /**
     * Redirect not logged in user
     */
    function buddydev_redirect_not_logged_user() {
            // Redirect visitors when they try to access members directory.
    	if ( ! is_user_logged_in() && bp_is_members_directory() ) {
    		bp_core_redirect( bp_get_referer_path() );
    	}
    }
    
    add_action( 'bp_template_redirect', 'buddydev_redirect_not_logged_user' );
    
    

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Auto create gallery #15242

    Hello Bjoerndz,

    I have checked this code on WordPress 4.9.6 with BuddyPress 3.0 ( Nouveau ) and it is working fine. Where you have put this code i.e. Active Theme “functions.php” or “bp-custom.php” file. Also try with newly register user weather it creates default galleries or not. Please let me know.

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Using both BuddyPress and PMPro Registration Pages? #15239

    Hello Ivanildo,

    Thank you for posting. To use both Registration is a difficult Instead of this we can assign a normal membership level when user register with BuddyPress and if he tries to access a restricted page we can ask for to level up of accessing that content.

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Mediapress Manage Settings Page #15238

    Hello Axel,

    Try the following code in you bp-custom.php file. We can not fix the position order. Please check.

    
    function buddydev_modify_gallery_nav_items() {
    
    	if ( ! function_exists( 'mediapress' ) || ! mpp_is_single_gallery() ) {
    		return;
    	}
    
    	if ( mpp_is_gallery_management() || mpp_is_media_management() ) {
    		return;
    	}
    
    	$links = '';
    
    	if ( mpp_user_can_edit_gallery( mpp_get_current_gallery_id() ) ) {
    		$url = mpp_get_gallery_settings_url( mpp_get_current_gallery() );
    		$links .= sprintf( '<li><a href="%1$s" title ="%2$s"> %3$s</a></li>', $url, _x( 'Edit Settings', 'Profile context menu rel attribute', 'mediapress' ), _x( 'Edit Settings', 'Profile context menu rel attribute', 'mediapress' ) );
    	}
    
    	echo $links;
    }
    
    add_action( 'bp_member_plugin_options_nav', 'buddydev_modify_gallery_nav_items' );
    
    

    Thank You
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: restricting member directory access #15237

    Hello David,

    You can use this code in your “bp-custom.php” file. To get more info please refer the following URL:
    https://codex.buddypress.org/themes/bp-custom-php/

    Thank You
    Ravi