Skip to:
Content
Pages
Categories
Search
Top
Bottom

change the css classes in bbp_template_notices() function

  • @nouarah

    Participant

    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)
  • @robin-w

    Moderator

    can I just ask why you need to change this class ame, rather than just style the class to what you want

    @nouarah

    Participant

    im using a frontend framwork with ready to use css classes so if this is possible it would be great

    @robin-w

    Moderator

    not really possible – sorry

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar