GravityView
2.17
The best, easiest way to display Gravity Forms entries on your website.
|
If this file is called directly, abort. More...
Public Member Functions | |
__construct () | |
_trigger_notifications ( $entry_id=0) | |
Passes approval notification and action hook to the send_notifications method. More... | |
after_submission ( $entry, $form) | |
Update the is_approved meta whenever the entry is submitted (and it contains a User Opt-in field) More... | |
after_update_entry_update_approved_meta ( $form, $entry_id=NULL) | |
Update the is_approved meta whenever the entry is updated. More... | |
ajax_update_approved () | |
Approve/Disapprove entries using the × or ✓ icons in the GF Entries screen. More... | |
Static Public Member Functions | |
static | add_approval_notification_events ( $notification_events=array(), $form=array()) |
Adds entry approval status change custom notification events. More... | |
static | autounapprove ( $form, $entry_id, $edit, $gv_data) |
Maybe unapprove entry on edit. More... | |
static | get_entry_status ( $entry, $value_or_label='label') |
Get the approval status for an entry. More... | |
static | get_popover_placement () |
Where should the popover be placed? More... | |
static | get_popover_template () |
Get HTML template for a popover used to display approval statuses. More... | |
static | update_approved ( $entry_id=0, $approved=2, $form_id=0, $approvedcolumn=0) |
update_approved function. More... | |
static | update_bulk ( $entries=array(), $approved=0, $form_id=0) |
Process a bulk of entries to update the approve field/property. More... | |
Data Fields | |
const | meta_key = 'is_approved' |
Private Member Functions | |
_send_notifications ( $entry_id='', $event='') | |
Passes along notification triggers to GFAPI::send_notifications() More... | |
add_hooks () | |
Add actions and filters related to entry approval. More... | |
Static Private Member Functions | |
static | add_approval_status_updated_note ( $entry_id, $approved=0) |
Add a note when an entry is approved. More... | |
static | get_approved_column_input_label ( $form, $approved_column) |
Get the value for the approved field checkbox. More... | |
static | update_approved_meta ( $entry_id, $status, $form_id=0) |
Update the is_approved entry meta value. More... | |
If this file is called directly, abort.
Generate linked list output for a list of entries.
Definition at line 23 of file class-gravityview-entry-approval.php.
__construct | ( | ) |
Definition at line 30 of file class-gravityview-entry-approval.php.
References add_hooks().
|
private |
Passes along notification triggers to GFAPI::send_notifications()
int | $entry_id | ID of entry being updated |
string | $event | Hook that triggered the notification. This is used as the key in the GF notifications array. |
Definition at line 92 of file class-gravityview-entry-approval.php.
References $entry, GV\$form, and gravityview().
Referenced by _trigger_notifications().
_trigger_notifications | ( | $entry_id = 0 | ) |
Passes approval notification and action hook to the send_notifications method.
Definition at line 74 of file class-gravityview-entry-approval.php.
References _send_notifications().
|
static |
Adds entry approval status change custom notification events.
array | $notification_events | The notification events. |
array | $form | The current form. |
Definition at line 119 of file class-gravityview-entry-approval.php.
|
staticprivate |
Add a note when an entry is approved.
int | $entry_id | Gravity Forms entry ID |
int | $approved | Approval status |
gravityview/approve_entries/add-note
filter or GravityView_Entry_Notes
class not existing gravityview/approve_entries/add-note
Add a note when the entry has been approved or disapproved? bool | $add_note | True: Yep, add that note! False: Do not, under any circumstances, add that note! |
Definition at line 449 of file class-gravityview-entry-approval.php.
References $entry, $form_id, GravityView_Entry_Notes\add_note(), GravityView_Entry_Approval_Status\APPROVED, GravityView_Entry_Approval_Status\DISAPPROVED, GravityView_Entry_Approval_Status\is_valid(), GravityView_Entry_Approval_Status\maybe_convert_status(), and GravityView_Entry_Approval_Status\UNAPPROVED.
|
private |
Add actions and filters related to entry approval.
Definition at line 39 of file class-gravityview-entry-approval.php.
Referenced by __construct().
after_submission | ( | $entry, | |
$form | |||
) |
Update the is_approved meta whenever the entry is submitted (and it contains a User Opt-in field)
is_approved
value upon submission$entry | array Gravity Forms entry object |
$form | array Gravity Forms form object |
gravityview/approve_entries/after_submission
Modify whether to run the after_submission process bool | $process_after_submission | default: true |
gravityview/approve_entries/after_submission/default_status
Modify the default approval status for newly submitted entries int | $default_status | See GravityView_Entry_Approval_Status() for valid statuses. |
Definition at line 250 of file class-gravityview-entry-approval.php.
References $entry, GV\$form, after_update_entry_update_approved_meta(), gravityview(), GravityView_Entry_Approval_Status\is_valid(), and GravityView_Entry_Approval_Status\UNAPPROVED.
after_update_entry_update_approved_meta | ( | $form, | |
$entry_id = NULL |
|||
) |
Update the is_approved meta whenever the entry is updated.
update_approved_meta
array | $form | Gravity Forms form array |
int | $entry_id | ID of the Gravity Forms entry |
If the form doesn't contain the approve field, don't assume anything.
gravityview/approve_entries/update_unapproved_meta
Filter the approval status on entry update. string | $value | The approval status. |
array | $form | The form. |
array | $entry | The entry. |
Definition at line 294 of file class-gravityview-entry-approval.php.
References $entry, GV\$form, $value, GravityView_Entry_Approval_Status\APPROVED, and GravityView_Entry_Approval_Status\DISAPPROVED.
Referenced by after_submission().
ajax_update_approved | ( | ) |
Approve/Disapprove entries using the × or ✓ icons in the GF Entries screen.
wp_send_json_error() wp_send_json_success()
Expects a $_POST request with the following $_POST keys and values:
array $_POST { int $form_id ID of the form connected to the entry being updated string|int $entry_slug The ID or slug of the entry being updated string $approved The value of the entry approval status {
Definition at line 171 of file class-gravityview-entry-approval.php.
References $current_status, $form_id, Utils\_POST(), GVCommon\get_entry_id(), gravityview(), GVCommon\has_cap(), and GravityView_Entry_Approval_Status\is_valid().
|
static |
Maybe unapprove entry on edit.
Called from gravityview/edit_entry/after_update
array | $form | Gravity Forms form array |
string | $entry_id | Numeric ID of the entry that was updated |
GravityView_Edit_Entry_Render | $edit | This object |
GravityView_View_Data | $gv_data | The View data |
gravityview/approve_entries/autounapprove/status
int | false | $approval_status | Approval status integer, or false if you want to not update status. Use GravityView_Entry_Approval_Status constants. Default: 3 (GravityView_Entry_Approval_Status::UNAPPROVED) |
array | $form | Gravity Forms form array |
string | $entry_id | Numeric ID of the entry that was updated |
\GV\View | $view | Current View where the entry was edited |
Definition at line 674 of file class-gravityview-entry-approval.php.
References GV\$form, View\by_id(), GVCommon\has_cap(), GravityView_Entry_Approval_Status\is_valid(), and GravityView_Entry_Approval_Status\UNAPPROVED.
|
staticprivate |
Get the value for the approved field checkbox.
When approving a field via the entry meta, use the correct value for the new approved column input
array | int | $form | Form ID or form array |
string | $approved_column | Approved column field ID |
Definition at line 547 of file class-gravityview-entry-approval.php.
References $field, GV\$form, and gravityview_get_field().
|
static |
Get the approval status for an entry.
array | int | string | $entry | Entry array, entry slug, or entry ID |
string | $value_or_label | "value" or "label" (default: "label") |
Definition at line 140 of file class-gravityview-entry-approval.php.
References $entry, GVCommon\get_entry_id(), GravityView_Entry_Approval_Status\get_label(), and GravityView_Entry_Approval_Status\maybe_convert_status().
Referenced by GravityView_Admin_ApproveEntries\add_entry_approved_hidden_input(), and GravityView_Field_Is_Approved\custom_merge_tags().
|
static |
Where should the popover be placed?
gravityview/approve_entries/popover_placement
Where should the popover be placed? string | $placement | Where to place the popover; 'right' (default ltr), 'left' (default rtl), 'top', or 'bottom' |
Definition at line 717 of file class-gravityview-entry-approval.php.
Referenced by GravityView_Admin_ApproveEntries\add_scripts_and_styles(), and GravityView_Field_Entry_Approval\enqueue_and_localize_script().
|
static |
Get HTML template for a popover used to display approval statuses.
Definition at line 740 of file class-gravityview-entry-approval.php.
References GravityView_Entry_Approval_Status\get_all().
Referenced by GravityView_Admin_ApproveEntries\add_scripts_and_styles(), and GravityView_Field_Entry_Approval\enqueue_and_localize_script().
|
static |
update_approved function.
int | $entry_id | (default: 0) |
int | $approved | (default: 2) |
int | $form_id | (default: 0) |
int | $approvedcolumn | (default: 0) |
Destroy the cache for this form
Definition at line 384 of file class-gravityview-entry-approval.php.
References $entry, $form_id, gravityview(), GravityView_Entry_Approval_Status\is_valid(), and GravityView_Entry_Approval_Status\maybe_convert_status().
Referenced by GravityView_Admin_ApproveEntries\update_approved(), and GravityView_Entry_Approval_Merge_Tags\update_approved().
|
staticprivate |
Update the is_approved
entry meta value.
after_update_entry_update_approved_meta
was previously to be named update_approved_meta
int | $entry_id | ID of the Gravity Forms entry |
string | $status | String whether entry is approved or not. 0 for not approved, Approved for approved. |
int | $form_id | ID of the form of the entry being updated. Improves query performance. |
gravityview/approve_entries/updated
Triggered when an entry approval is updated int | $entry_id | ID of the Gravity Forms entry |
string | int | $status | String whether entry is approved or not. See GravityView_Entry_Approval_Status for valid statuses. |
gravityview/approve_entries/{$action}
Triggered when an entry approval is set. {$action} can be 'approved', 'unapproved', or 'disapproved' Note: If you want this to work with Bulk Actions, run in a plugin rather than a theme; the bulk updates hook runs before themes are loaded. int | $entry_id | ID of the Gravity Forms entry |
Definition at line 577 of file class-gravityview-entry-approval.php.
References $field, GV\$form, $form_id, GVCommon\get_form(), GravityView_Entry_Approval_Status\get_key(), gravityview(), GravityView_Entry_Approval_Status\is_valid(), and GravityView_Entry_Approval_Status\maybe_convert_status().
|
static |
Process a bulk of entries to update the approve field/property.
array | boolean | $entries | If array, array of entry IDs that are to be updated. If true: update all entries. |
int | $approved | Approved status. If 0 : unapproved, if not empty, Approved |
int | $form_id | The Gravity Forms Form ID |
Definition at line 338 of file class-gravityview-entry-approval.php.
References $entries, $form_id, gravityview(), GVCommon\has_cap(), and GravityView_Entry_Approval_Status\is_valid().
Referenced by GravityView_Bulk_Actions\process_bulk_action().
const meta_key = 'is_approved' |
Definition at line 28 of file class-gravityview-entry-approval.php.
Referenced by gvfield\callback(), gravityview\callback(), View\content(), GravityView_Admin_ApproveEntries\filter_links_entry_list(), View\get_entries(), Views_Route\get_sub_item_permissions_check(), GravityView_frontend\is_entry_approved(), GravityView_frontend\process_search_only_approved(), and oEmbed\render_frontend().