Skip to content

Instantly share code, notes, and snippets.

@imath imath/bp-custom.php Secret
Created Oct 5, 2019

Embed
What would you like to do?
Restore the old password control
<?php
/**
*
* This file is to paste in wp-content/plugins/bp-custom.php
*
*/
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
function restore_old_password_controle_js() {
if ( bp_is_register_page() || bp_is_user_settings_general() ) {
wp_dequeue_script( 'user-profile' );
wp_enqueue_script( 'bp-nouveau-password-verify' );
}
}
add_action( 'bp_nouveau_enqueue_scripts', 'restore_old_password_controle_js' );
<?php
/**
*
* This file is to paste in wp-content/themes/youractivetheme/buddypress/members/register.php
*
*/
?>
<?php bp_nouveau_signup_hook( 'before', 'page' ); ?>
<div id="register-page"class="page register-page">
<?php bp_nouveau_template_notices(); ?>
<?php bp_nouveau_user_feedback( bp_get_current_signup_step() ); ?>
<form action="" name="signup_form" id="signup-form" class="standard-form signup-form clearfix" method="post" enctype="multipart/form-data">
<div class="layout-wrap">
<?php if ( 'request-details' === bp_get_current_signup_step() ) : ?>
<?php bp_nouveau_signup_hook( 'before', 'account_details' ); ?>
<div class="register-section default-profile" id="basic-details-section">
<?php /***** Basic Account Details ******/ ?>
<h2 class="bp-heading"><?php esc_html_e( 'Account Details', 'buddypress' ); ?></h2>
<label for="signup_username"><?php _e( 'Username', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
<?php
/**
* Fires and displays any member registration username errors.
*
* @since 1.1.0
*/
do_action( 'bp_signup_username_errors' ); ?>
<input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value(); ?>" <?php bp_form_field_attributes( 'username' ); ?>/>
<label for="signup_email"><?php _e( 'Email Address', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
<?php
/**
* Fires and displays any member registration email errors.
*
* @since 1.1.0
*/
do_action( 'bp_signup_email_errors' ); ?>
<input type="email" name="signup_email" id="signup_email" value="<?php bp_signup_email_value(); ?>" <?php bp_form_field_attributes( 'email' ); ?>/>
<label for="signup_password"><?php _e( 'Choose a Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
<?php
/**
* Fires and displays any member registration password errors.
*
* @since 1.1.0
*/
do_action( 'bp_signup_password_errors' ); ?>
<input type="password" name="signup_password" id="signup_password" value="" class="password-entry" <?php bp_form_field_attributes( 'password' ); ?>/>
<div id="pass-strength-result"></div>
<label for="signup_password_confirm"><?php _e( 'Confirm Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
<?php
/**
* Fires and displays any member registration password confirmation errors.
*
* @since 1.1.0
*/
do_action( 'bp_signup_password_confirm_errors' ); ?>
<input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" class="password-entry-confirm" <?php bp_form_field_attributes( 'password' ); ?>/>
</div><!-- #basic-details-section -->
<?php bp_nouveau_signup_hook( 'after', 'account_details' ); ?>
<?php /***** Extra Profile Details ******/ ?>
<?php if ( bp_is_active( 'xprofile' ) && bp_nouveau_base_account_has_xprofile() ) : ?>
<?php bp_nouveau_signup_hook( 'before', 'signup_profile' ); ?>
<div class="register-section extended-profile" id="profile-details-section">
<h2 class="bp-heading"><?php esc_html_e( 'Profile Details', 'buddypress' ); ?></h2>
<?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?>
<?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
<div<?php bp_field_css_class( 'editfield' ); ?>>
<fieldset>
<?php
$field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
$field_type->edit_field_html();
bp_nouveau_xprofile_edit_visibilty();
?>
</fieldset>
</div>
<?php endwhile; ?>
<input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_field_ids(); ?>" />
<?php endwhile; ?>
<?php bp_nouveau_signup_hook( '', 'signup_profile' ); ?>
</div><!-- #profile-details-section -->
<?php bp_nouveau_signup_hook( 'after', 'signup_profile' ); ?>
<?php endif; ?>
<?php if ( bp_get_blog_signup_allowed() ) : ?>
<?php bp_nouveau_signup_hook( 'before', 'blog_details' ); ?>
<?php /***** Blog Creation Details ******/ ?>
<div class="register-section blog-details" id="blog-details-section">
<h2><?php esc_html_e( 'Site Details', 'buddypress' ); ?></h2>
<p><label for="signup_with_blog"><input type="checkbox" name="signup_with_blog" id="signup_with_blog" value="1" <?php checked( (int) bp_get_signup_with_blog_value(), 1 ); ?>/> <?php esc_html_e( "Yes, i'd like to create a new site", 'buddypress' ); ?></label></p>
<div id="blog-details"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class="show"<?php endif; ?>>
<?php bp_nouveau_signup_form( 'blog_details' ); ?>
</div>
</div><!-- #blog-details-section -->
<?php bp_nouveau_signup_hook( 'after', 'blog_details' ); ?>
<?php endif; ?>
<?php endif; // request-details signup step ?>
</div><!-- //.layout-wrap -->
<?php bp_nouveau_signup_hook( 'custom', 'steps' ); ?>
<?php if ( 'request-details' === bp_get_current_signup_step() ) : ?>
<?php if ( bp_signup_requires_privacy_policy_acceptance() ) : ?>
<?php bp_nouveau_signup_privacy_policy_acceptance_section(); ?>
<?php endif; ?>
<?php bp_nouveau_submit_button( 'register' ); ?>
<?php endif; ?>
</form>
</div>
<?php bp_nouveau_signup_hook( 'after', 'page' ); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.