bp_core_render_message

Render the 'template_notices' feedback message.

Description

bp_core_render_message(); 

The hook action template_notices is used to call this function, it is not called directly.


Usage

  1. if ( !function_exists( 'bp_core_render_message' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_core_render_message(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-core/bp-core-functions.php  
  1. function bp_core_render_message() { 
  2.  
  3. // Get BuddyPress. 
  4. $bp =buddypress); 
  5.  
  6. if ( !empty( $bp->template_message ) ) : 
  7. $type = ( 'success' === $bp->template_message_type ) ? 'updated' : error; 
  8.  
  9. /** 
  10. * Filters the 'template_notices' feedback message content. 
  11. * @since 1.5.5 
  12. * @param string $template_message Feedback message content. 
  13. * @param string $type The type of message being displayed. 
  14. * Either 'updated' or error. 
  15. */ 
  16. $content = apply_filters( 'bp_core_render_message_content', $bp->template_message, $type ); ?> 
  17.  
  18. <div id="message" class="bp-template-notice <?php echo esc_attr( $type ); ?>"> 
  19.  
  20. <?php echo $content; ?> 
  21.  
  22. </div> 
  23.  
  24. <?php 
  25.  
  26. /** 
  27. * Fires after the display of any template_notices feedback messages. 
  28. * @since 1.1.0 
  29. */ 
  30.  
  31. endif;