bp_nouveau_template_notices()

Template tag to display feedback notices to users, if there are to display

Description

Source

File: bp-templates/bp-nouveau/includes/template-tags.php

231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
function bp_nouveau_template_notices() {
    $bp         = buddypress();
    $bp_nouveau = bp_nouveau();
 
    if ( ! empty( $bp->template_message ) ) {
        // Clone BuddyPress template message to avoid altering it.
        $template_message = array( 'message' => $bp->template_message );
 
        if ( ! empty( $bp->template_message_type ) ) {
            $template_message['type'] = $bp->template_message_type;
        }
 
        // Adds a 'dimiss' (button) key to array - set true/false.
        $template_message['dismiss'] = false;
 
        // Set dismiss button true for sitewide notices
        if ( 'bp-sitewide-notice' == $template_message['type'] ) {
            $template_message['dismiss'] = true;
        }
 
        $bp_nouveau->template_message = $template_message;
        bp_get_template_part( 'common/notices/template-notices' );
 
        // Reset just after rendering it.
        $bp_nouveau->template_message = array();
 
        /**
         * Fires after the display of any template_notices feedback messages.
         *
         * @since BuddyPress 3.0.0
         */
        do_action( 'bp_core_render_message' );
    }
 
    /**
     * Fires towards the top of template pages for notice display.
     *
     * @since BuddyPress 3.0.0
     */
    do_action( 'template_notices' );
}

Changelog

Changelog
Version Description
BuddyPress 3.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.