Auto-allow Access for Administrators

Code

Filename: gpsa-auto-allow-administrator-access.php

<?php
/**
 * Gravity Perks // Submit to Access // Auto-allow Access for Administrators
 * https://gravitywiz.com/documentation/gravity-forms-submit-to-access/
 */
add_filter( 'gpsa_has_access', function( $has_access ) {
	if ( current_user_can( 'administrator' ) ) {
		return true;
	}

	return $has_access;
} );

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.