diff --git a/src/bp-templates/bp-nouveau/includes/template-tags.php b/src/bp-templates/bp-nouveau/includes/template-tags.php
index 895035283..1257f1614 100644
a
|
b
|
function bp_nouveau_signup_form( $section = 'account_details' ) { |
2074 | 2074 | } |
2075 | 2075 | |
2076 | 2076 | foreach ( $fields as $name => $attributes ) { |
| 2077 | $classes = ''; |
| 2078 | |
2077 | 2079 | list( $label, $required, $value, $attribute_type, $type, $class ) = array_values( $attributes ); |
2078 | 2080 | |
2079 | 2081 | if ( $required ) { |
… |
… |
function bp_nouveau_signup_form( $section = 'account_details' ) { |
2132 | 2134 | $attribute_type = ' ' . checked( $value, $submitted, false ); |
2133 | 2135 | } |
2134 | 2136 | |
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. |
| 2137 | // Do not run function to display errors for the private radio. |
2142 | 2138 | if ( 'private' !== $value ) { |
2143 | | /** |
2144 | | * Fires and displays any member registration field errors. |
| 2139 | |
| 2140 | /* |
| 2141 | * Fetch & display any BP member registration field errors. |
2145 | 2142 | * |
2146 | | * @since 1.1.0 (BuddyPress) |
| 2143 | * Passes BP signup errors to Nouveau's template function to |
| 2144 | * render suitable markup for error string. |
2147 | 2145 | */ |
2148 | | do_action( "bp_{$name}_errors" ); |
| 2146 | if( isset( buddypress()->signup->errors[ $name ] ) ) { |
| 2147 | nouveau_error_template( buddypress()->signup->errors[ $name ] ); |
| 2148 | $invalid = 'invalid'; |
| 2149 | } |
| 2150 | } |
| 2151 | |
| 2152 | if ( isset( $invalid ) && isset( buddypress()->signup->errors[ $name ] ) ) { |
| 2153 | if ( $class ) { |
| 2154 | $class = $class . ' ' . $invalid; |
| 2155 | } else { |
| 2156 | $class = $invalid; |
| 2157 | } |
| 2158 | } |
| 2159 | |
| 2160 | if ( $class ) { |
| 2161 | $class = sprintf( |
| 2162 | ' class="%s"', |
| 2163 | esc_attr( join( ' ', array_map( 'sanitize_html_class', explode( ' ', $class ) ) ) ) |
| 2164 | ); |
2149 | 2165 | } |
2150 | 2166 | |
2151 | 2167 | // Set the input. |
… |
… |
function bp_nouveau_submit_button( $action ) { |
2231 | 2247 | do_action( $submit_data['after'] ); |
2232 | 2248 | } |
2233 | 2249 | } |
| 2250 | |
| 2251 | /** |
| 2252 | * Display supplemental error or feedback messages. |
| 2253 | * |
| 2254 | * This template handles in page error or feedback messages e.g signup fields |
| 2255 | * 'Username exists' type registration field error notices. |
| 2256 | * |
| 2257 | * @param string $message required: the message to display. |
| 2258 | * @param string $type optional: the type of error message e.g 'error'. |
| 2259 | * |
| 2260 | * @since 1.0.0 |
| 2261 | */ |
| 2262 | function nouveau_error_template( $message = '', $type = '' ) { |
| 2263 | if ( ! $message ) { |
| 2264 | return; |
| 2265 | } |
| 2266 | |
| 2267 | $type = ( $type ) ? $type : 'error'; |
| 2268 | ?> |
| 2269 | |
| 2270 | <div class="<?php echo esc_attr( 'bp-messages bp-feedback ' . $type ); ?>"> |
| 2271 | <span class="bp-icon" aria-hidden="true"></span> |
| 2272 | <p><?php echo esc_html( $message ); ?></p> |
| 2273 | </div> |
| 2274 | |
| 2275 | <?php |
| 2276 | } |