forked from gravitywiz/snippet-library
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create gpeb-show-admin-all-entries.php
- Loading branch information
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* Gravity Perks // Entry Blocks // Show Admins All Entries | ||
* https://gravitywiz.com/documentation/gravity-forms-entry-blocks/ | ||
* | ||
* If your Entries block is configured to only show users their own entries, this snippet will allow you to show users | ||
* with the "Administrator" role all entries. | ||
*/ | ||
add_filter( 'gpeb_entries_query', function( $processed_filter_groups, $form_id, $block_context ) { | ||
if ( current_user_can( 'administrator' ) ) { | ||
$processed_filter_groups = array(); | ||
} | ||
return $processed_filter_groups; | ||
}, 10, 3 ); |