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
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
| 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.