bp_nouveau_get_blog_signup_inline_script()

Inline script to toggle the signup blog form

Description

Return

(string) Javascript output

Source

File: bp-templates/bp-nouveau/includes/blogs/functions.php

144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
function bp_nouveau_get_blog_signup_inline_script() {
    return '
        ( function( $ ) {
            if ( $( \'body\' ).hasClass( \'register\' ) ) {
                var blog_checked = $( \'#signup_with_blog\' );
 
                // hide "Blog Details" block if not checked by default
                if ( ! blog_checked.prop( \'checked\' ) ) {
                    $( \'#blog-details\' ).toggle();
                }
 
                // toggle "Blog Details" block whenever checkbox is checked
                blog_checked.change( function( event ) {
                    // Toggle HTML5 required attribute.
                    $.each( $( \'#blog-details\' ).find( \'[aria-required]\' ), function( i, input ) {
                        $( input ).prop( \'required\',  $( event.target ).prop( \'checked\' ) );
                    } );
 
                    $( \'#blog-details\' ).toggle();
                } );
            }
        } )( jQuery );
    ';
}

Changelog

Changelog
Version Description
BuddyPress 3.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.