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: 25299

    You are welcome 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25299

    Hi,
    You are accessing the formatted value for display.

    Please use the raw value using

    
    
    $values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $field_id, $user_id ) );
    
    

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25299
    Brajesh Singh on in reply to: [Resolved] BuddyPress Registration Control #47876

    Hi Tosin,
    The problem with above code is the option group name and section name.

    Please find it updated here.

    
    <?php
    /*
    * Plugin Name: BuddyPress Registration Control
    * Description: Allows administrators to enable or disable user registration and select a URL to redirect to when registration is disabled.
    * Version: 1.0
    */
    
    // Register the new setting in the BuddyPress options group
    function custom_bp_register_settings() {
    	register_setting( 'buddypress', 'bp-disable-site-registration', 'sanitize_text_field' );
    	register_setting( 'buddypress', 'bp-disable-site-registration-redirection-url', 'sanitize_text_field' );
    }
    add_action( 'bp_register_admin_settings', 'custom_bp_register_settings' );
    
    // Add the new setting to the BuddyPress options page
    function custom_bp_add_settings_field() {
    	add_settings_field(
    		'bp-disable-site-registration',
    		__( 'Registration', 'buddypress' ),
    		'custom_bp_settings_field_html',
    		'buddypress',
    		'bp_main',
    		array(
    			'label_for' => 'bp-disable-site-registration',
    		)
    	);
    	add_settings_field(
    		'bp-disable-site-registration-redirection-url',
    		__( 'Redirection URL', 'buddypress' ),
    		'custom_bp_settings_redirection_url_html',
    		'buddypress',
    		'bp_main',
    		array(
    			'label_for' => 'bp-disable-site-registration-redirection-url',
    		)
    	);
    }
    add_action( 'bp_register_admin_settings', 'custom_bp_add_settings_field', 10, 1 );
    
    // Output the HTML for the setting field
    function custom_bp_settings_field_html() {
    	$value = get_option( 'bp-disable-site-registration', 'open' );
    	?>
    	<select name="bp-disable-site-registration" id="bp-disable-site-registration">
    		<option value="open" <?php selected( $value, 'open' ); ?>><?php _e( 'Open', 'buddypress' ); ?></option>
    		<option value="closed" <?php selected( $value, 'closed' ); ?>><?php _e( 'Closed', 'buddypress' ); ?></option>
    	</select>
    	<?php
    }
    
    // Output the HTML for the redirection URL field
    function custom_bp_settings_redirection_url_html() {
    	$value = get_option( 'bp-disable-site-registration-redirection-url' );
    	?>
    	<input type="text" name="bp-disable-site-registration-redirection-url" id="bp-disable-site-registration-redirection-url" value="<?php echo esc_attr( $value ); ?>" />
    	<?php
    }
    
    // Redirect users if registration is closed
    function custom_bp_redirect_registration() {
    	if ( get_option( 'bp-disable-site-registration' ) === 'closed' ) {
    		wp_redirect( get_option( 'bp-disable-site-registration-redirection-url' ) );
    		exit;
    	}
    }
    add_action( 'bp_screens', 'custom_bp_redirect_registration' );
    
    

    I did not go through other sections of your code. In case you need assistance there, I can look into that.

    Regards
    Brajesh

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

    Hi,
    It seems your subscription for the Moderation tools expired. That’s why you were unable to download it.

    I have shared a copy via google drive. If it asks for login, Please use the link from my next reply. I will be marking the link private after next 24 hours.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25299
    Brajesh Singh on in reply to: Contact Form CSS #47872

    Hi John,
    Thank you for the link. I see what is happening there now. You are using Youzer which is forcefully resetting all the theme styles.
    All our plugins uses the ‘standard-form’ class on form element, so any theme which follows BuddyPress’s convention work. Youzify/Youzer does not follow the convention and that’s why it is broken.

    Please allow us couple of days, we will add the css to override Youzer’s.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25299
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25299
    Brajesh Singh on in reply to: Contact Form CSS #47855

    Hi John,
    Thank you for the question.

    1. Are you referring to BuddyPress User Contact Form plugin?

    2. yes, it can be moved to other sections on profile. Please let me know where you want to move it?

    3. We have provided basic css to let it mostly inherit styles from the theme being used. Please let me know where & how you want it to look like and will assist.

    Have a great day!

    Regards
    Brajesh

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

    Hi Daria,
    Happy New Year!

    I am sorry for the issue. Sharing my email in next private reply.

    I will look into quickly and assit.

    Regards
    Brajesh