BBP_Replies_Admin::updated_messages( array $messages )

Custom user feedback messages for reply post type

Description

Parameters

$messages

(Required)

Return

(array)

Source

File: bp-forums/admin/replies.php

	public function updated_messages( $messages ) {
		global $post_ID;

		if ( $this->bail() ) return $messages;

		// URL for the current topic
		$topic_url = bbp_get_topic_permalink( bbp_get_reply_topic_id( $post_ID ) );

		// Current reply'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( __( 'Reply updated. <a href="%s">View topic</a>', 'buddyboss' ), $topic_url ),

			// Custom field updated
			2 => __( 'Custom field updated.', 'buddyboss' ),

			// Custom field deleted
			3 => __( 'Custom field deleted.', 'buddyboss' ),

			// Reply updated
			4 => __( 'Reply updated.', 'buddyboss' ),

			// Restored from revision
			// translators: %s: date and time of the revision
			5 => isset( $_GET['revision'] )
					? sprintf( __( 'Reply restored to revision from %s', 'buddyboss' ), wp_post_revision_title( (int) $_GET['revision'], false ) )
					: false,

			// Reply created
			6 => sprintf( __( 'Reply created. <a href="%s">View topic</a>', 'buddyboss' ), $topic_url ),

			// Reply saved
			7 => __( 'Reply saved.', 'buddyboss' ),

			// Reply submitted
			8 => sprintf( __( 'Reply submitted. <a target="_blank" href="%s">Preview topic</a>', 'buddyboss' ), esc_url( add_query_arg( 'preview', 'true', $topic_url ) ) ),

			// Reply scheduled
			9 => sprintf( __( 'Reply scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview topic</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 ),

			// Reply draft updated
			10 => sprintf( __( 'Reply draft updated. <a target="_blank" href="%s">Preview topic</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.