Ticket #7642: 7642.patch
File 7642.patch, 2.4 KB (added by , 7 years ago) |
---|
-
src/bp-templates/bp-nouveau/includes/template-tags.php
739 739 } 740 740 741 741 } elseif ( ! empty( $bp_nouveau->object_nav ) ) { 742 742 743 $bp_nouveau->displayed_nav = $bp_nouveau->object_nav; 743 744 744 745 /** … … 751 752 * @param array $n The arguments of the Navigation loop. 752 753 */ 753 754 $nav = apply_filters( 'bp_nouveau_get_nav', $nav, $n ); 755 754 756 } 755 757 756 758 $bp_nouveau->sorted_nav = array_values( $nav ); … … 2138 2140 $class = ' class="' . esc_attr( join( ' ', array_map( 'sanitize_html_class', $classes ) ) ) . '"'; 2139 2141 } 2140 2142 2141 // Do not fire the do_action to display errors for the private radio.2143 // Do not run function to display errors for the private radio. 2142 2144 if ( 'private' !== $value ) { 2145 2143 2146 /** 2144 * F ires and displays anymember registration field errors.2147 * Fetch & display any BP member registration field errors. 2145 2148 * 2146 * @since 1.1.0 (BuddyPress) 2149 * Passes BP signup errors to Nouveau's template function to 2150 * render suitable markup for error string. 2147 2151 */ 2148 do_action( "bp_{$name}_errors" ); 2152 if( isset( buddypress()->signup->errors[$name] ) ) { 2153 nouveau_error_template( buddypress()->signup->errors[$name], 'error' ); 2154 } 2149 2155 } 2150 2156 2151 2157 // Set the input. … … 2231 2237 do_action( $submit_data['after'] ); 2232 2238 } 2233 2239 } 2240 2241 /** 2242 * Display supplemental error or feedback messages 2243 * 2244 * This template handles in page error or feedback messages e.g signup fields 2245 * 'Username exists' type registration fields error notice. 2246 * 2247 * @param string $string required: the message to display. 2248 * @param string $type optional: the type of error message e.g 'error'. 2249 * 2250 * @todo Could this requirement to handle additional messages be better served by 2251 * passing strings into the main Nouveau feedback messages array to be rendered 2252 * by the main template include for notices. 2253 * 2254 * @since 1.0.0 2255 */ 2256 function nouveau_error_template( $string = '', $type = '' ) { 2257 2258 if ( ! $string ) 2259 return; 2260 ?> 2261 2262 <div class="bp-messages bp-feedback <?php echo esc_attr( $type ); ?>"> 2263 <span class="bp-icon" aria-hidden="true"></span> 2264 <p><?php echo esc_html( $string ); ?></p> 2265 </div> 2266 2267 <?php 2268 return; 2269 }