GravityView_Entry_Notes
Class GravityView_Entry_Notes
Since: 1.15
Source: includes/class-gravityview-entry-notes.php:16
Details
- Kind:
class - Namespace:
(global)
Methods
| Method | Description |
|---|---|
__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
| Name | Type | Default | Description |
|---|---|---|---|
$lead_id | int | ID of the Entry | |
$user_id | int | ID of the user creating the note | |
$user_name | string | User name of the user creating the note | |
$note | string | '' | Note content. |
$note_type | string | '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
| Name | Type | Default | Description |
|---|---|---|---|
$note_id | int | Entry 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
| Name | Type | Default | Description |
|---|---|---|---|
$note_ids | int[] | [] | 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
| Name | Type | Default | Description |
|---|---|---|---|
$entry_id | int | Entry 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
| Name | Type | Default | Description |
|---|---|---|---|
$note_id | int | The ID of the note in the {prefix}_rg_lead_notes table |
Returns
object|false— False if not found; note object otherwise.
Since:
1.17TODO 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
| Name | Type | Default | Description |
|---|---|---|---|
$avatar | string | '' | Avatar image, if available. 48px x 48px by default. |
$note | object | null | Note 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