BBP_Forums_Admin::updated_messages( array $messages )

Custom user feedback messages for forum post type

Description

Parameters

$messages

(Required)

Return

(array)

Source

File: bp-forums/admin/forums.php

604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
public function updated_messages( $messages ) {
    global $post_ID;
 
    if ( $this->bail() ) return $messages;
 
    // URL for the current forum
    $forum_url = bbp_get_forum_permalink( $post_ID );
 
    // Current forum's post_date
    $post_date = bbp_get_global_post_field( 'post_date', 'raw' );
 
    // Messages array
    $messages[$this->post_type] = array(
        0 =>  '', // Left empty on purpose
 
        // Updated
        1 =>  sprintf( __( 'Forum updated. <a href="%s">View forum</a>', 'buddyboss' ), $forum_url ),
 
        // Custom field updated
        2 => __( 'Custom field updated.', 'buddyboss' ),
 
        // Custom field deleted
        3 => __( 'Custom field deleted.', 'buddyboss' ),
 
        // Forum updated
        4 => __( 'Forum updated.', 'buddyboss' ),
 
        // Restored from revision
        // translators: %s: date and time of the revision
        5 => isset( $_GET['revision'] )
                ? sprintf( __( 'Forum restored to revision from %s', 'buddyboss' ), wp_post_revision_title( (int) $_GET['revision'], false ) )
                : false,
 
        // Forum created
        6 => sprintf( __( 'Forum created. <a href="%s">View forum</a>', 'buddyboss' ), $forum_url ),
 
        // Forum saved
        7 => __( 'Forum saved.', 'buddyboss' ),
 
        // Forum submitted
        8 => sprintf( __( 'Forum submitted. <a target="_blank" href="%s">Preview forum</a>', 'buddyboss' ), esc_url( add_query_arg( 'preview', 'true', $forum_url ) ) ),
 
        // Forum scheduled
        9 => sprintf( __( 'Forum scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview forum</a>', 'buddyboss' ),
                // translators: Publish box date format, see http://php.net/date
                date_i18n( __( 'M j, Y @ G:i', 'buddyboss' ),
                strtotime( $post_date ) ),
                $forum_url ),
 
        // Forum draft updated
        10 => sprintf( __( 'Forum draft updated. <a target="_blank" href="%s">Preview forum</a>', 'buddyboss' ), esc_url( add_query_arg( 'preview', 'true', $forum_url ) ) ),
    );
 
    return $messages;
}

Changelog

Changelog
Version Description
bbPress (r3080) 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.