Show Admins All Entries

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.

Code

Filename: gpeb-show-admin-all-entries.php

<?php
/**
 * 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 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.