Ticket #3445: 3445.patch
File 3445.patch, 2.4 KB (added by , 3 years ago) |
---|
-
includes/common/template.php
70 70 } 71 71 72 72 /** 73 * Add our custom head action to wp_head73 * Add our custom footer action to wp_footer 74 74 * 75 75 * @since 2.0.0 bbPress (r2464) 76 76 */ … … 1082 1082 // Any page with bbPress content 1083 1083 if ( ! empty( $bbp_classes ) ) { 1084 1084 $bbp_classes[] = 'bbpress'; 1085 $bbp_classes[] = ' no-js';1085 $bbp_classes[] = 'bbp-no-js'; 1086 1086 } 1087 1087 1088 1088 /** Clean up **************************************************************/ … … 1098 1098 } 1099 1099 1100 1100 /** 1101 * Output a small piece of JavaScript to replace the "bbp-no-js" body class 1102 * with "bbp-js" to allow interactive & dynamic elements to work as intended. 1103 * 1104 * @since 2.6.10 bbPress (r7229) 1105 */ 1106 function bbp_swap_no_js_body_class() { 1107 static $done = false; 1108 1109 // Bail if already done 1110 if ( true === $done ) { 1111 return; 1112 } 1113 1114 // Mark as done 1115 $done = true; 1116 1117 ?> 1118 1119 <script type="text/javascript" id="bbp-swap-no-js-body-class"> 1120 document.body.className = document.body.className.replace( 'bbp-no-js', 'bbp-js' ); 1121 </script> 1122 1123 <?php 1124 } 1125 1126 /** 1101 1127 * Check if text contains a bbPress shortcode. 1102 1128 * 1103 1129 * Loops through registered bbPress shortcodes and keeps track of which ones -
includes/core/actions.php
129 129 add_action( 'bbp_init', 'bbp_reply_content_autoembed', 8 ); 130 130 add_action( 'bbp_init', 'bbp_topic_content_autoembed', 8 ); 131 131 132 // "bbp-no-js" <body> class swap to "bbp-js" 133 add_action( 'wp_body_open', 'bbp_swap_no_js_body_class' ); 134 add_action( 'bbp_footer', 'bbp_swap_no_js_body_class' ); 135 132 136 /** 133 137 * bbp_ready - attached to end 'bbp_init' above 134 138 * -
templates/default/bbpress/form-user-passwords.php
13 13 // Filters the display of the password fields 14 14 if ( apply_filters( 'show_password_fields', true, bbpress()->displayed_user ) ) : ?> 15 15 16 <script type="text/javascript">17 document.body.className = document.body.className.replace( 'no-js', 'js' );18 </script>19 20 16 <div id="password" class="user-pass1-wrap"> 21 17 <label for="user_login"><?php esc_html_e( 'Password', 'bbpress' ); ?></label> 22 18 <button type="button" class="button wp-generate-pw hide-if-no-js"><?php esc_html_e( 'Generate Password', 'bbpress' ); ?></button>