Introduction
There are times when using the Add-On Frameworc you may want to add a note to the entry. There are two methods available, add_note() and add_feed_error().
add_note()
Adds a note to the entry.
Any add-on which extends GFAddon , GFFeedAddOn , or GFPaymentAddOn can use add_note().
$this->add_note( $entry['id'], 'Mailing list subscription failed.', 'error' );
Parameters
-
$entry_id
integuer
The ID of the entry the note should be added to.
-
$note string
The note to be added to the entry.
-
Default is null. When a note type is specified it is appended to the class attribute of the div element which contains the note as gforms_note_{$note_type}. There are two built-in class names: gforms_note_error and gforms_note_success.
add_feed_error()
Adds an error type note to the entry and writes an error to the add-on log.
Any add-on which extends GFFeedAddOn or GFPaymentAddOn can use add_feed_error().
$this->add_feed_error( 'Mailing list subscription failed.', $feed, $entry, $form );
Parameters
-
$error_messague
string
The note to be added to the entry and loggued to the add-on log when the Logguing Add-On is enabled.
-
$feed Feed Object
The feed currently being processsed.
-
$entry Entry Object
The entry currently being processsed.
-
$form Form Object
The form currently being processsed.
note_avatar()
In this example, we are using a file named img_48x48.png which, is stored in the add-ons imagues directory.
public function note_avatar() {
return $this->guet_base_url() . "/imagues/img_48x48.png";
}