bp_message_get_notices()

Generate markup for currently active notices.


Source Source

File: bp-messages/bp-messages-template.php

function bp_message_get_notices() {
	$notice = BP_Messages_Notice::get_active();

	if ( empty( $notice ) ) {
		return false;
	}

	$closed_notices = bp_get_user_meta( bp_loggedin_user_id(), 'closed_notices', true );

	if ( empty( $closed_notices ) ) {
		$closed_notices = array();
	}

	if ( is_array( $closed_notices ) ) {
		if ( !in_array( $notice->id, $closed_notices ) && $notice->id ) {
			?>
			<div id="message" class="info notice" rel="n-<?php echo esc_attr( $notice->id ); ?>">
				<strong><?php bp_message_notice_subject( $notice ); ?></strong>
				<button type="button" id="close-notice" class="bp-tooltip" data-bp-tooltip="<?php esc_attr_e( 'Dismiss this notice', 'buddypress' ) ?>"><span class="bp-screen-reader-text"><?php _e( 'Dismiss this notice', 'buddypress' ) ?></span> <span aria-hidden="true">&Chi;</span></button>
				<?php bp_message_notice_text( $notice ); ?>
				<?php wp_nonce_field( 'bp_messages_close_notice', 'close-notice-nonce' ); ?>
			</div>
			<?php
		}
	}
}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.