- Timestamp:
- 12/12/2017 02:41:37 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/includes/template-tags.php
r11707 r11770 740 740 741 741 } elseif ( ! empty( $bp_nouveau->object_nav ) ) { 742 742 743 $bp_nouveau->displayed_nav = $bp_nouveau->object_nav; 743 744 … … 752 753 */ 753 754 $nav = apply_filters( 'bp_nouveau_get_nav', $nav, $n ); 755 754 756 } 755 757 … … 2075 2077 2076 2078 foreach ( $fields as $name => $attributes ) { 2079 $classes = ''; 2080 2077 2081 list( $label, $required, $value, $attribute_type, $type, $class ) = array_values( $attributes ); 2078 2082 … … 2133 2137 } 2134 2138 2135 if ( ! empty( $class ) ) { 2136 // In case people are adding classes.. 2137 $classes = explode( ' ', $class ); 2138 $class = ' class="' . esc_attr( join( ' ', array_map( 'sanitize_html_class', $classes ) ) ) . '"'; 2139 } 2140 2141 // Do not fire the do_action to display errors for the private radio. 2139 // Do not run function to display errors for the private radio. 2142 2140 if ( 'private' !== $value ) { 2141 2143 2142 /** 2144 * F ires and displays anymember registration field errors.2143 * Fetch & display any BP member registration field errors. 2145 2144 * 2146 * @since 1.1.0 (BuddyPress) 2145 * Passes BP signup errors to Nouveau's template function to 2146 * render suitable markup for error string. 2147 2147 */ 2148 do_action( "bp_{$name}_errors" ); 2148 if( isset( buddypress()->signup->errors[ $name ] ) ) { 2149 nouveau_error_template( buddypress()->signup->errors[ $name ] ); 2150 $invalid = 'invalid'; 2151 } 2152 } 2153 2154 if ( isset( $invalid ) && isset( buddypress()->signup->errors[ $name ] ) ) { 2155 if ( ! empty( $class ) ) { 2156 $class = $class . ' ' . $invalid; 2157 } else { 2158 $class = $invalid; 2159 } 2160 } 2161 2162 if ( $class ) { 2163 $class = sprintf( 2164 ' class="%s"', 2165 esc_attr( join( ' ', array_map( 'sanitize_html_class', explode( ' ', $class ) ) ) ) 2166 ); 2149 2167 } 2150 2168 … … 2232 2250 } 2233 2251 } 2252 2253 /** 2254 * Display supplemental error or feedback messages. 2255 * 2256 * This template handles in page error or feedback messages e.g signup fields 2257 * 'Username exists' type registration field error notices. 2258 * 2259 * @param string $message required: the message to display. 2260 * @param string $type optional: the type of error message e.g 'error'. 2261 * 2262 * @since 1.0.0 2263 */ 2264 function nouveau_error_template( $message = '', $type = '' ) { 2265 if ( ! $message ) { 2266 return; 2267 } 2268 2269 $type = ( $type ) ? $type : 'error'; 2270 ?> 2271 2272 <div class="<?php echo esc_attr( 'bp-messages bp-feedback ' . $type ); ?>"> 2273 <span class="bp-icon" aria-hidden="true"></span> 2274 <p><?php echo esc_html( $message ); ?></p> 2275 </div> 2276 2277 <?php 2278 }
Note: See TracChangeset
for help on using the changeset viewer.