public function add_note($note = '')
{
$note = trim($note);
if (empty($note)) {
return false;
}
$notes = $this->get_raw_notes();
if (empty($notes)) {
$notes = '';
}
$note_string = date_i18n('F j, Y H:i:s', current_time('timestamp')) . ' - ' . $note;
$new_note = apply_filters('give_customer_add_note_string', $note_string);
$notes .= "\n\n" . $new_note;
do_action('give_customer_pre_add_note', $new_note, $this->id);
$updated = $this->update(array('notes' => $notes));
if ($updated) {
$this->notes = $this->get_notes();
}
do_action('give_customer_post_add_note', $this->notes, $new_note, $this->id);
// Return the formatted note, so we can test, as well as update any displays
return $new_note;
}