Automattic\WooCommerce\Admin\Notes

Note::set_status()publicWC 1.0

Set note status.

Method of the class: Note{}

No Hooks.

Return

null. Nothing (null).

Usage

$Note = new Note();
$Note->set_status( $status );
$status(string) (required)
Note status.

Note::set_status() code WC 8.7.0

public function set_status( $status ) {
	if ( empty( $status ) ) {
		$this->error( 'admin_note_invalid_data', __( 'The admin note status prop cannot be empty.', 'woocommerce' ) );
	}

	if ( ! in_array( $status, self::get_allowed_statuses(), true ) ) {
		$this->error(
			'admin_note_invalid_data',
			sprintf(
				/* translators: %s: admin note status property. */
				__( 'The admin note status prop (%s) is not one of the supported statuses.', 'woocommerce' ),
				$status
			)
		);
	}

	$this->set_prop( 'status', $status );
}