Skip to main content

GravityView_Entry_Notes

Class GravityView_Entry_Notes

Since: 1.15

Source: includes/class-gravityview-entry-notes.php:16

Details

  • Kind: class
  • Namespace: (global)

Methods

MethodDescription
__construct()GravityView_Entry_Notes constructor.
add_note()Alias for GFFormsModel::add_note() with default note_type of 'gravityview'
delete_note()Alias for GFFormsModel::delete_note()
delete_notes()Delete an array of notes
get_notes()Alias for GFFormsModel::get_lead_notes()
get_note()Get a single note by note ID
filter_avatar()Use the GravityView avatar for notes created by GravityView

Method Reference

__construct()

public function __construct()

GravityView_Entry_Notes constructor.

Source: includes/class-gravityview-entry-notes.php:21

add_note()

public static function add_note( $lead_id, $user_id, $user_name, $note='', $note_type='gravityview' )

Alias for GFFormsModel::add_note() with default note_type of 'gravityview'

Parameters

NameTypeDefaultDescription
$lead_idintID of the Entry
$user_idintID of the user creating the note
$user_namestringUser name of the user creating the note
$notestring''Note content.
$note_typestring'gravityview'Type of note. Default: gravityview

Returns

  • int | WP_Error — Note ID, if success. WP_Error with $wpdb->last_error message, if failed.

See Also

Since:

Source: includes/class-gravityview-entry-notes.php:49

delete_note()

public static function delete_note( $note_id )

Alias for GFFormsModel::delete_note()

Parameters

NameTypeDefaultDescription
$note_idintEntry note ID

See Also

Source: includes/class-gravityview-entry-notes.php:99

delete_notes()

public static function delete_notes( $note_ids=[] )

Delete an array of notes

Alias for GFFormsModel::delete_notes()

Parameters

NameTypeDefaultDescription
$note_idsint[][]Array of entry note ids

Source: includes/class-gravityview-entry-notes.php:110

get_notes()

public static function get_notes( $entry_id )

Alias for GFFormsModel::get_lead_notes()

Parameters

NameTypeDefaultDescription
$entry_idintEntry to get notes for

Returns

  • stdClass[] | null — Integer-keyed array of note objects

See Also

  • GFFormsModel::get_lead_notes

Source: includes/class-gravityview-entry-notes.php:130

get_note()

public static function get_note( $note_id )

Get a single note by note ID

Parameters

NameTypeDefaultDescription
$note_idintThe ID of the note in the {prefix}_rg_lead_notes table

Returns

  • object | false — False if not found; note object otherwise.

Since:

  • 1.17
  • TODO Deprecated in favor of GFAPI::get_note()

Deprecated: TODO

Source: includes/class-gravityview-entry-notes.php:159

filter_avatar()

public static function filter_avatar( $avatar='', $note=null )

Use the GravityView avatar for notes created by GravityView

Note: The function is static so that it's easier to remove the filter: remove_filter( 'gform_notes_avatar', array( 'GravityView_Entry_Notes', 'filter_avatar' ) );

Parameters

NameTypeDefaultDescription
$avatarstring''Avatar image, if available. 48px x 48px by default.
$noteobjectnullNote object with id, user_id, date_created, value, note_type, user_name, user_email vars.

Returns

  • string — Possibly-modified avatar.

Since: 1.15

Source: includes/class-gravityview-entry-notes.php:181