Messages::send_notice( $args,  $assoc_args )

Send a notice.


Description Description

Top ↑

OPTIONS OPTIONS

–subject= : Subject of the notice/message.

–content= : Content of the notice.

Top ↑

EXAMPLE EXAMPLE

$ wp bp message send-notice --subject="Important notice" --content="We need to improve"
Success: Notice was successfully sent.

Source Source

File: cli/src/messages.php

	public function send_notice( $args, $assoc_args ) {
		$notice            = new \BP_Messages_Notice();
		$notice->subject   = $assoc_args['subject'];
		$notice->message   = $assoc_args['content'];
		$notice->date_sent = bp_core_current_time();
		$notice->is_active = 1;

		// Send it.
		if ( $notice->save() ) {
			WP_CLI::success( 'Notice was successfully sent.' );
		} else {
			WP_CLI::error( 'Notice was not sent.' );
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

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