• Resolved semmtex

    (@semmtex)


    Hi,

    I was wondering if there’s a widget or spot reserved for BuddyPress notices. In my case I’m using the BuddyPress Profile Completion plug-in from BuddyDev which makes it mandatory for people to fill out their profile before browsing the members directory. It displays a message using the BuddyPress notices hook (.bp-template-notice .error classes) if a profile is incomplete. However, since I built the User Profile using BuddyBuilder this message is not displayed and user are simply redirected to the edit profile page, without knowing why…

    Do you happen to have any insight into how to make this message appear.

    Thanks in advance.

    • This topic was modified 2 years, 9 months ago by semmtex.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter semmtex

    (@semmtex)

    I managed to solve it by myself. If anybody else is looking for a solution, here’s how I solved it:

    I looked for the function that renders the notices in BuddyPress and made a shortcode out of it, added that to the BuddyBuilder User Profile page and styled it with some CSS.

    function nmr_bp_render_notices() {
    	// Get BuddyPress
    	$bp = buddypress();
    
    	if ( ! empty( $bp->template_message ) ) :
    		$type    = ( 'success' === $bp->template_message_type ) ? 'updated' : 'error';
    		$content = apply_filters( 'bp_core_render_message_content', $bp->template_message, $type ); ?>
    
    		<div id="message" class="nmr-bp-notice <?php echo esc_attr( $type ); ?>">
    
    			<?php echo $content; ?>
    
    		</div>
    
    	<?php
    
    		do_action( 'bp_core_render_message' );
    
    	endif;
    }
    add_shortcode('bp_notices', 'nmr_bp_render_notices');
    • This reply was modified 2 years, 9 months ago by semmtex. Reason: SOLVED
    Plugin Support john

    (@johnweru)

    Hey there,

    I’m glad to hear that you managed to have this figured out.

    Thanks for sharing the solution as well.

    Kind Regards,

    John

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘BuddyPress Notices’ is closed to new replies.