Changeset 7230
- Timestamp:
- 02/17/2022 06:36:20 PM (3 years ago)
- Location:
- branches/2.6/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/src/includes/common/template.php
r7221 r7230 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) … … 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 … … 1096 1096 // Filter & return 1097 1097 return (array) apply_filters( 'bbp_body_class', $classes, $bbp_classes, $wp_classes, $custom_classes ); 1098 } 1099 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 1098 1124 } 1099 1125 -
branches/2.6/src/includes/core/actions.php
r7087 r7230 130 130 add_action( 'bbp_init', 'bbp_topic_content_autoembed', 8 ); 131 131 132 // <body> class swap from "bbp-no-js" 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 … … 138 142 */ 139 143 add_action( 'bbp_ready', 'bbp_setup_akismet', 2 ); // Spam prevention for topics and replies 144 145 // Setup BuddyPress using its own hook 140 146 add_action( 'bp_include', 'bbp_setup_buddypress', 10 ); // Social network integration 141 147 -
branches/2.6/src/templates/default/bbpress/form-user-passwords.php
r7189 r7230 13 13 // Filters the display of the password fields 14 14 if ( apply_filters( 'show_password_fields', true, bbpress()->displayed_user ) ) : ?> 15 16 <script type="text/javascript">17 document.body.className = document.body.className.replace( 'no-js', 'js' );18 </script>19 15 20 16 <div id="password" class="user-pass1-wrap"> -
branches/2.6/src/templates/default/css/bbpress.css
r7189 r7230 9 9 -------------------------------------------------------------- */ 10 10 11 /* Hide completely (including from screen readers) */ 11 12 .hidden, 12 . no-js .hide-if-no-js,13 . js .hide-if-js {13 .bbp-no-js .hide-if-no-js, 14 .bbp-js .hide-if-js { 14 15 display: none; 15 16 } 16 17 17 /* Hide visually but not from screen readers*/18 /* Hide visually (but not from screen readers) */ 18 19 .screen-reader-text, 19 20 .screen-reader-text span,
Note: See TracChangeset
for help on using the changeset viewer.