Skip to:
Content
Pages
Categories
Search
Top
Bottom

change the css classes in bbp_template_notices() function


  • Nowarah
    Participant

    @nouarah

    hello, I need to change the css class”bbp-template-notice” of the returned html in the function bbp_template_notices() exist in includes/common/template.php but i dont see any filter in it , how this can be done?

    the function:

    function bbp_template_notices() {
    
    	// Bail if no notices or errors
    	if ( ! bbp_has_errors() ) {
    		return;
    	}
    
    	// Define local variable(s)
    	$errors = $messages = array();
    
    	// Get bbPress
    	$bbp = bbpress();
    
    	// Loop through notices
    	foreach ( $bbp->errors->get_error_codes() as $code ) {
    
    		// Get notice severity
    		$severity = $bbp->errors->get_error_data( $code );
    
    		// Loop through notices and separate errors from messages
    		foreach ( $bbp->errors->get_error_messages( $code ) as $error ) {
    			if ( 'message' === $severity ) {
    				$messages[] = $error;
    			} else {
    				$errors[]   = $error;
    			}
    		}
    	}
    
    	// Display errors first...
    	if ( ! empty( $errors ) ) : ?>
    
    		<div class="bbp-template-notice error" role="alert" tabindex="-1">
    			<ul>
    				<li><?php echo implode( "</li>\n<li>", $errors ); ?></li>
    			</ul>
    		</div>
    
    	<?php endif;
    
    	// ...and messages last
    	if ( ! empty( $messages ) ) : ?>
    
    		<div class="bbp-template-notice">
    			<ul>
    				<li><?php echo implode( "</li>\n<li>", $messages ); ?></li>
    			</ul>
    		</div>
    
    	<?php endif;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar