GravityView_Field_Notes
Add Entry Notes
Since: 1.17
Source: includes/extensions/entry-notes/class-gravityview-field-notes.php:18
Details
- Kind:
class - Namespace:
(global) - Extends:
GravityView_Field
Properties
| Property | Type | Description |
|---|---|---|
$file | string | Current FILE |
$path | string | plugin_dir_path() of the current field file |
$name | string | The name of the GravityView field type |
$icon | string | Icon class for the field. |
Methods
| Method | Description |
|---|---|
__construct() | Constructor. |
add_entry_default_field() | Add Entry Notes to the Add Field picker in Edit View |
register_scripts() | Registers scripts and styles used in the UI. |
enqueue_scripts() | Enqueues and localizes scripts and styles. |
maybe_add_note() | Verify permissions, check if $_POST is set and as expected. If so, use process_add_note. |
maybe_delete_notes() | Possibly delete notes, if request is proper. |
process_delete_notes() | Handle deleting notes. |
add_template_path() | Include this extension templates path. |
strings() | Get strings used by the Entry Notes field. |
display_note() | Generate HTML output for a single note. |
get_add_note_part() | Get the Add Note form HTML. |
Method Reference
__construct()
public function __construct()
Constructor.
Source: includes/extensions/entry-notes/class-gravityview-field-notes.php:52
add_entry_default_field()
public function add_entry_default_field( $entry_default_fields, $form, $zone )
Add Entry Notes to the Add Field picker in Edit View
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry_default_fields | array | Fields configured to show in the picker | |
$form | array | Gravity Forms form array | |
$zone | string | Current context: directory, single, edit |
Returns
array— Fields array with notes added, if in Multiple Entries or Single Entry context
See Also
Since: 1.17
Source: includes/extensions/entry-notes/class-gravityview-field-notes.php:106
register_scripts()
public function register_scripts()
Registers scripts and styles used in the UI.
Returns
void
Since: 1.17
Source: includes/extensions/entry-notes/class-gravityview-field-notes.php:127
enqueue_scripts()
public function enqueue_scripts()
Enqueues and localizes scripts and styles.
Returns
void
Since: 1.17
Source: includes/extensions/entry-notes/class-gravityview-field-notes.php:141
maybe_add_note()
public function maybe_add_note()
Verify permissions, check if $_POST is set and as expected. If so, use process_add_note.
Returns
void
See Also
Since: 1.17
Source: includes/extensions/entry-notes/class-gravityview-field-notes.php:180
maybe_delete_notes()
public function maybe_delete_notes()
Possibly delete notes, if request is proper.
Verify permissions. Check expected $_POST. Parse args, then send to process_delete_notes.
Returns
void
See Also
Since: 1.17
Source: includes/extensions/entry-notes/class-gravityview-field-notes.php:404
process_delete_notes()
public function process_delete_notes( $data )
Handle deleting notes.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$data | array | { Array of deletion data. |
Returns
void
Since: 1.17
Source: includes/extensions/entry-notes/class-gravityview-field-notes.php:454
add_template_path()
public function add_template_path( $file_paths )
Include this extension templates path.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$file_paths | array | List of template paths ordered. |
Returns
array— File paths with./and./partials/paths added.
Since: 1.17
Source: includes/extensions/entry-notes/class-gravityview-field-notes.php:490
strings()
public static function strings( $key='' )
Get strings used by the Entry Notes field.
Use gravityview/field/notes/strings filter to modify the strings.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$key | string | '' | If set, return the string with the key of $key. |
Returns
array|string— Array of strings with keys and values. If $key is set, returns string. If missing $strings[ $key ], empty string.
Since: 1.17
Source: includes/extensions/entry-notes/class-gravityview-field-notes.php:548
display_note()
public static function display_note( $note, $show_delete=false, $context=null )
Generate HTML output for a single note.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$note | object | Note object with id, user_id, date_created, value, note_type, user_name, user_email vars. | |
$show_delete | bool | false | Whether to show the bulk delete inputs. |
$context | \GV\Template_Context | null | The context. |
Returns
string— HTML.
Since:
Source: includes/extensions/entry-notes/class-gravityview-field-notes.php:604
get_add_note_part()
public static function get_add_note_part( $atts, $context=null )
Get the Add Note form HTML.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$atts | array | Shortcode attributes for entry ID. | |
$context | \GV\Template_Context | null | The context, when called outside of a shortcode. |
Returns
string— HTML of the Add Note form, or empty string if the user doesn't have thegravityview_add_entry_notescap.
Since:
Source: includes/extensions/entry-notes/class-gravityview-field-notes.php:719