function bp_signup_page($echo = true)
{
    global $bp;
    if (bp_has_custom_signup_page()) {
        if ($echo) {
            echo $bp->root_domain . '/' . BP_REGISTER_SLUG;
        } else {
            return $bp->root_domain . '/' . BP_REGISTER_SLUG;
        }
    } else {
        if ($echo) {
            echo $bp->root_domain . '/wp-signup.php';
        } else {
            return $bp->root_domain . '/wp-signup.php';
        }
    }
}
Exemplo n.º 2
0
/**
 * Replace the generated password in the welcome email with '[User Set]'.
 *
 * On a standard BP installation, users who register themselves also set their
 * own passwords. Therefore there is no need for the insecure practice of
 * emailing the plaintext password to the user in the welcome email.
 *
 * This filter will not fire when a user is registered by the site admin.
 *
 * @param string $welcome_email Complete email passed through WordPress.
 * @param int $blog_id ID of the blog user is joining.
 * @param int $user_id ID of the user joining.
 * @param string $password Password of user.
 * @return string Filtered $welcome_email with $password replaced by '[User Set]'.
 */
function bp_core_filter_blog_welcome_email( $welcome_email, $blog_id, $user_id, $password ) {

	// Don't touch the email when a user is registered by the site admin
	if ( ( is_admin() || is_network_admin() ) && buddypress()->members->admin->signups_page != get_current_screen()->id ) {
		return $welcome_email;
	}

	// Don't touch the email if we don't have a custom registration template
	if ( ! bp_has_custom_signup_page() )
		return $welcome_email;

	// [User Set] Replaces $password in welcome email; Represents value set by user
	return str_replace( $password, __( '[User Set]', 'buddypress' ), $welcome_email );
}
/**
 * Redirect away from wp-signup.php if BP registration templates are present.
 *
 * @since 1.1.0
 */
function bp_core_wpsignup_redirect()
{
    // Bail in admin or if custom signup page is broken.
    if (is_admin() || !bp_has_custom_signup_page()) {
        return;
    }
    $action = !empty($_GET['action']) ? $_GET['action'] : '';
    // Not at the WP core signup page and action is not register.
    if (!empty($_SERVER['SCRIPT_NAME']) && false === strpos('wp-signup.php', $_SERVER['SCRIPT_NAME']) && 'register' != $action) {
        return;
    }
    bp_core_redirect(bp_get_signup_page());
}
/**
 * Get the URL to the signup page.
 *
 * @return string
 */
function bp_get_signup_page()
{
    if (bp_has_custom_signup_page()) {
        $page = trailingslashit(bp_get_root_domain() . '/' . bp_get_signup_slug());
    } else {
        $page = bp_get_root_domain() . '/wp-signup.php';
    }
    /**
     * Filters the URL to the signup page.
     *
     * @since 1.1.0
     *
     * @param string $page URL to the signup page.
     */
    return apply_filters('bp_get_signup_page', $page);
}
function bp_get_signup_page()
{
    global $bp;
    if (bp_has_custom_signup_page()) {
        $page = trailingslashit(bp_get_root_domain() . '/' . bp_get_signup_slug());
    } else {
        $page = bp_get_root_domain() . '/nxt-signup.php';
    }
    return apply_filters('bp_get_signup_page', $page);
}
Exemplo n.º 6
0
/**
 * Replace the generated password in the welcome email with '[User Set]'.
 *
 * On a standard BP installation, users who register themselves also set their
 * own passwords. Therefore there is no need for the insecure practice of
 * emailing the plaintext password to the user in the welcome email.
 *
 * This filter will not fire when a user is registered by the site admin.
 *
 * @param string $welcome_email Complete email passed through WordPress.
 * @param int $blog_id ID of the blog user is joining.
 * @param int $user_id ID of the user joining.
 * @param string $password Password of user.
 * @return string Filtered $welcome_email with $password replaced by '[User Set]'.
 */
function bp_core_filter_blog_welcome_email($welcome_email, $blog_id, $user_id, $password)
{
    // Don't touch the email when a user is registered by the site admin.
    if (is_admin()) {
        return $welcome_email;
    }
    // Don't touch the email if we don't have a custom registration template
    if (!bp_has_custom_signup_page()) {
        return $welcome_email;
    }
    // [User Set] Replaces $password in welcome email; Represents value set by user
    return str_replace($password, __('[User Set]', 'buddypress'), $welcome_email);
}
Exemplo n.º 7
0
/**
 * Redirect away from gd signup if BP registration templates are present.
 *
 * @since 1.0.0
 * @package GeoDirectory_BuddyPress_Integration
 */
function geodir_buddypress_gdsignup_redirect()
{
    if (!get_option('geodir_buddypress_bp_register')) {
        return;
    }
    // Bail in admin or logged in
    if (is_admin() || !bp_has_custom_signup_page() || is_user_logged_in()) {
        return;
    }
    $geodir_signup = !empty($_GET['geodir_signup']) ? true : false;
    $sign_up = !empty($_GET['page1']) && trim($_GET['page1']) == 'sign_up' ? true : false;
    // Not at the WP core signup page and action is not register
    if (!empty($_SERVER['SCRIPT_NAME']) && false !== strpos($_SERVER['SCRIPT_NAME'], 'index.php') && $geodir_signup) {
        // adds class to gd signup page
        add_filter('body_class', 'geodir_buddypress_body_class', 100);
        add_action('wp_head', 'geodir_buddypress_custom_style');
        add_action('login_form', 'geodir_buddypress_login_form');
        if (!$sign_up) {
            return;
        }
    } else {
        return;
    }
    bp_core_redirect(bp_get_signup_page());
}
Exemplo n.º 8
0
	function bp_get_signup_page() {
		global $bp;

		if ( bp_has_custom_signup_page() )
			$page = $bp->root_domain . '/' . BP_REGISTER_SLUG;
		else
			$page = $bp->root_domain . '/wp-signup.php';

		return apply_filters( 'bp_get_signup_page', $page );
	}