Forum Replies Created

Viewing 1 replies (of 1 total)
  • montymccune

    (@montymccune)

    very simple question from a VERY NEWB WP developer – however, I have 12 years programming xp (js, .net, ios, etc) 🙂

    I’m using GIVE to create a donation form and i’m trying to figure out how to use/access the $payment_id in a function called from a hook in the DonationConfirmation page.

    here’s an example of what I’m trying to do. I know I’m missing something sooooo rudimentary here….

    function check_success_update_child_sponsor_status($payment_id)
      {
    	$postId = get_the_ID();	
            echo $payment_id;
    	
    	$post = give_get_payment_meta($payment_id);
    		foreach($post as $key => $value){
    		  $valuet = trim($value);
    		  if('_' == $valuet{0})
    			continue;
    		  echo $key . " => " . $value . "<br/>";
    		}
    }
    
    add_action( 'give_payment_receipt_after_table', 'check_success_update_child_sponsor_status', 10, 1 );

    I have actually called the above code w/ a hardcoded payment id and I see the results i want, but cant figure out how to use the param $payment_id.

    what am I missing here? thanks so much 🙂

Viewing 1 replies (of 1 total)