0
votes

I have a few gravity forms that need entries approving for each user. To do this I am using (https://en-gb.wordpress.org/plugins/gravityformsapprovals/)

I am having trouble trying to display the approval status on a page template (front end). As mentioned here I have echoed out the user meta using the code below and no 'approval status' was found in the array. I have contacted the developer but still no response.

Any ideas on how I can do this please?

$all_meta_for_user = get_user_meta( 47 );
  print_r( $all_meta_for_user );
1

1 Answers

0
votes

The approval status is stored in the entry meta, not the user meta so you need to use gform_get_meta() not get_user_meta(). Like this:

$entry_status    = gform_get_meta( $entry_id, 'approval_status' );
$status_for_user = gform_get_meta( $entry_id, 'approval_status_' . $user_id );

It's also in the entry itself:

$entry           = GFAPI::get_entry( $entry_id );
$entry_status    = $entry['approval_status'];
$status_for_user = $entry[ 'approval_status_' . $user_id ];