BBP_Topics_Admin::updated_messages( array $messages )

Custom user feedback messages for topic post type

Description

Parameters

$messages

(Required)

Return

(array)

Source

File: bp-forums/admin/topics.php

999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
public function updated_messages( $messages ) {
    global $post_ID;
 
    if ( $this->bail() ) return $messages;
 
    // URL for the current topic
    $topic_url = bbp_get_topic_permalink( $post_ID );
 
    // Current topic'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( __( 'Discussion updated. <a href="%s">View discussion</a>', 'buddyboss' ), $topic_url ),
 
        // Custom field updated
        2 => __( 'Custom field updated.', 'buddyboss' ),
 
        // Custom field deleted
        3 => __( 'Custom field deleted.', 'buddyboss' ),
 
        // Discussion updated
        4 => __( 'Discussion updated.', 'buddyboss' ),
 
        // Restored from revision
        // translators: %s: date and time of the revision
        5 => isset( $_GET['revision'] )
                ? sprintf( __( 'Discussion restored to revision from %s', 'buddyboss' ), wp_post_revision_title( (int) $_GET['revision'], false ) )
                : false,
 
        // Discussion created
        6 => sprintf( __( 'Discussion created. <a href="%s">View discussion</a>', 'buddyboss' ), $topic_url ),
 
        // Discussion saved
        7 => __( 'Discussion saved.', 'buddyboss' ),
 
        // Discussion submitted
        8 => sprintf( __( 'Discussion submitted. <a target="_blank" href="%s">Preview discussion</a>', 'buddyboss' ), esc_url( add_query_arg( 'preview', 'true', $topic_url ) ) ),
 
        // Discussion scheduled
        9 => sprintf( __( 'Discussion scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview discussion</a>', 'buddyboss' ),
                // translators: Publish box date format, see http://php.net/date
                date_i18n( __( 'M j, Y @ G:i', 'buddyboss' ),
                strtotime( $post_date ) ),
                $topic_url ),
 
        // Discussion draft updated
        10 => sprintf( __( 'Discussion draft updated. <a target="_blank" href="%s">Preview discussion</a>', 'buddyboss' ), esc_url( add_query_arg( 'preview', 'true', $topic_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.