BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Badges size does not change #34505

    Hi Marcel,

    Thank you for posting. Please try hard reloading your page or clear browser cache and check whether this rule is applying to the image or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] How to Disable all BuddyPress Emails via PHP #34504

    Hello Jkk,

    Please try plugin “Disable Emails” by WebAware and use the following code.

    
    add_filter( 'bp_email_use_wp_mail', '__return_true' );
    
    

    Please let me know if it works or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Post As Group Name – Not As User Profile #34503

    Hello Roni,

    Try in “bp-custom.php file”. Take a look at the following URL:

    https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Contact form – Show on profile #34496

    Hello Tom,

    Please try the following code and let me know if it works or not.

    
    /**
     * Render contact form after profile loop
     */
    function buddydev_after_profile_loop_render_contact_form() {
    
    	if ( ! function_exists( 'bpucf' ) ) {
    		return;
    	}
    
    	$is_visible = bpucf_is_form_visible( bp_displayed_user_id() );
    
    	if ( ! $is_visible ) {
    		return;
    	}
    
    	echo '<h4>' . __( 'Contact Me' ) . '</h4>';
    	// Render contact form after profile loop.
    	bpucf_load_form();
    }
    add_action( 'bp_after_profile_loop_content', 'buddydev_after_profile_loop_render_contact_form' );
    
    /**
     * Modify contact user form fields
     *
     * @param array $fields Form fields.
     *
     * @return mixed
     */
    function buddydev_modify_form_fields( $fields ) {
    
    	$fields['city'] = array(
    		'name'     => 'city',
    		'type'     => 'text',
    		'label'    => __( 'City', 'buddypress-user-contact-form' ),
    		'required' => false,
    		'position' => 4,
    	);
    
    	return $fields;
    }
    add_filter( 'bpucf_form_fields', 'buddydev_modify_form_fields' );
    
    /**
     * Append your field data to the message
     *
     * @param string $message Message content.
     *
     * @return string
     */
    function buddydev_modify_message_content( $message ) {
    
    	if ( ! empty( $_POST['city'] ) ) {
    		$city = sanitize_text_field( $_POST['city'] );
    		$message .= __( 'City: ' ) . $city;
    	}
    
    	return $message;
    }
    add_filter( 'bpucf_message_content', 'buddydev_modify_message_content' );
    
    

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Post As Group Name – Not As User Profile #34495

    Hello Roni,

    Please check the following code. It will modify activity action for activities posted by the group’s admin or moderator.

    
    /**
     * Modify group action
     *
     * @param string               $action   Group action.
     * @param BP_Activity_Activity $activity Activity object.
     *
     * @return string
     */
    function buddydev_modify_groups_activity_action( $action, $activity ) {
    
    	if ( 'groups' != $activity->component || 'activity_update' != $activity->type ) {
    		return $action;
    	}
    
    	if ( groups_is_user_admin( $activity->user_id, $activity->item_id ) || groups_is_user_mod( $activity->user_id, $activity->item_id ) ) {
    		$group = groups_get_group( $activity->item_id );
    
    		$action = sprintf( '<a href="%s">%s</a> posted an update.</a>', bp_get_group_permalink( $group ), $group->name );
    	}
    
    	return $action;
    }
    add_action( 'bp_get_activity_action', 'buddydev_modify_groups_activity_action', 10, 2 );
    
    

    Please let me know if it works or not.

    Regards
    Ravi

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

    Hello Gordon,

    Thank you for posting. Please try the following code. It will allow space in username. You can find more regular expressions to avoid special characters.

    
    
    /**
     * Validate user name
     *
     * @param WP_Error $error Error object.
     * @param string   $new_user_name New user name.
     *
     * @return string
     */
    function buddydev_validate_user_name( $error, $new_user_name ) {
    
    	if ( $error->has_errors() ) {
    		return $error;
    	}
    
    	if ( preg_match('/\s/',$new_user_name ) ) {
    		$error->add( 'contains_spaces', __( 'User name can not have space in it' ) );
    	}
    
    	return $error;
    }
    add_filter( 'bp_username_changer_validation_errors', 'buddydev_validate_user_name', 10, 2 );
    
    

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Anonymous Posting Plugin for Activity Feed #34364

    Hello April,

    Try the following in your bp-custom.php file and let me know if it works or not

    
    
    /**
     * Modify modified activity action for groups
     *
     * @param string               $action Modified action.
     * @param BP_Activity_Activity $activity Activity object.
     *
     * @return mixed
     */
    function buddydev_modify_groups_format_activity_action_activity_update( $action, $activity ) {
    
    	if ( function_exists( 'bp_is_anonymous_activity' ) && bp_is_anonymous_activity( $activity->id ) ) {
    		$action = $activity->action;
    	}
    
    	return $action;
    }
    add_filter('bp_groups_format_activity_action_activity_update', 'buddydev_modify_groups_format_activity_action_activity_update', 10, 2 );
    
    

    Regards
    Ravi

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

    Hello Maria,

    Please try using a plugin named ‘Loco Translate’. You can check for plugin description here:

    https://wordpress.org/plugins/loco-translate/

    Give it a shot

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Buddyboss Auto Join Groups #34160

    Hello Mike,

    Buddyboss uses the following field values in the Gender field.

    
    her_Female
    his_Male
    

    Try these values and let me know if it works or not.

    check

    https://tinyurl.com/y24ca4sc

    Regards
    Ravi

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

    Hello,

    You should use these shortcodes with context. Try in the following way

    // Display displayed user display name

    
    [bpsc-user-display-name context="displayed"]
    
    

    // Logged-in user registeration date.

    
    [bpsc-user-registration-date context="logged_in"]
    
    

    Regards
    Ravi