Skip to content

Instantly share code, notes, and snippets.

@zackkatz
zackkatz / gv-divi-widgets.php
Last active March 8, 2023 17:50 — forked from rafaehlers/gv-divi-widgets.php
Prevent a Divi-powered theme from disabling GravityView's widgets when the View is embedded in a page
<?php
/**
* Prevent Divi from using the "Grab the first post image" setting.
*
* It uses et_first_image() which uses apply_filters( 'the_content' ) which causes
* a conflict GravityView, which uses 'the_content' filter.
*
* @param bool $setting Is the setting enabled and the request is not Buddypress?
*
@zackkatz
zackkatz / gv-remote-entry-approval-notes.php
Created March 10, 2023 19:56 — forked from rafaehlers/gv-remote-entry-approval-notes.php
Prevent Entry Approval Notes from displaying on the View
<?php // DO NOT COPY THIS LINE
add_filter( 'gravityview/entry_notes/get_notes', 'gv_remove_entry_approval_notes', 10, 2 );
function gv_remove_entry_approval_notes( $notes, $entry_id ) {
foreach($notes as $key => $note){
if (strpos( $note->value, 'WordPress') !== false){
unset( $notes[ $key] );
}
}
return $notes;
@zackkatz
zackkatz / gravityview-claim-entry-by-user-data.php
Last active February 17, 2026 02:13 — forked from bennemann/gravity-view-claim-entry-by-user-data.php
Modify whether the currently logged-in user can edit an entry that was not created by them
<?php
add_filter( 'gravityview/edit_entry/user_can_edit_entry', 'gv_claim_entry_by_user_data', 20, 3 );
/**
* Allow logged-in users to edit entries where their user data matches a field value in the entry.
*
* Supports multiple Views, each with its own field to check against the current user's display name.
*
* @see https://docs.gravitykit.com/article/520-allow-user-edit-field-match