Skip to content

Commit 57b61dd

Browse files
authored
gpi-show-inventory-only-for-logged-in-users.php: Added snippet to show available inventory message only for logged in user.
1 parent 59ebc5c commit 57b61dd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/**
3+
* Gravity Perks // Inventory // Show Inventory Only For Logged In users
4+
* https://gravitywiz.com/documentation/gravity-forms-inventory/
5+
*
6+
* Instruction Video: https://www.loom.com/share/2d9843302a54456987ed2c66a83612ba
7+
*
8+
* By default the inventory available is shown for everyone, if enabled.
9+
* Use this filter to show the inventory available only for logged in users.
10+
*/
11+
add_filter( 'gpi_inventory_available_message', function( $message ) {
12+
if ( is_user_logged_in() ) {
13+
return $message;
14+
}
15+
return '';
16+
} );

0 commit comments

Comments
 (0)