Skip to content

Instantly share code, notes, and snippets.

@bennemann
bennemann / gravity-view-claim-entry-by-user-data.php
Created May 19, 2021 19:10
Modify whether the currently logged-in user can edit an entry that was not created by him
<?php
add_filter('gravityview/edit_entry/user_can_edit_entry', 'gv_claim_entry_by_user_data', 20, 3 );
/**
* Modify whether the currently logged-in user can edit an entry that was not created by him
*
* @param boolean $user_can_edit Can the current user edit the current entry? (Default: false)
* @param array $entry Gravity Forms entry array
* @param int $view_id ID of the view you want to check visibility against {@since 1.15}
*
@bennemann
bennemann / gravity-view-claim-entry-by-email.php
Created March 20, 2020 22:16
Modify whether the currently logged-in user can edit an entry that was not created by him
<?php
add_filter('gravityview/edit_entry/user_can_edit_entry', 'gv_claim_entry_by_email', 20, 3 );
/**
* Modify whether the currently logged-in user can edit an entry that was not created by him
*
* @param boolean $user_can_edit Can the current user edit the current entry? (Default: false)
* @param array $entry Gravity Forms entry array
* @param int $view_id ID of the view you want to check visibility against {@since 1.15}
*
@bennemann
bennemann / gravity-view-hide-closed-days.php
Last active March 22, 2020 22:10
Hide closed days for selected view on Gravity Forms Business Hours plugin by GravityView
<?php
add_filter('gravityforms_business_hours_output_closed_template', 'gv_dont_show_closed_days', 10, 3 );
/**
* Hides business hours for closed days on selected view.
*
* @param string $output_template HTML code
* @param string $day Day of the week value
* @param array $replacements Default values to replace with *
*