Using the code from the answer you linked in your question (untested at present):
add_filter( 'gform_paypalpaymentspro_args_before_payment','add_donation_comment', 10, 2 );
function add_donation_comment( $args, $form_id ) { // do not edit $args or $form_id
global $blog_id; // Make this available to the function
// Apply filter only if blog id is 2
if ( 2 !== $blog_id ) {
return $args;
}
// apply to form 1 only
if ( 1 == $form_id ) { // Replace '1' with your form id
$args["COMMENT1"] = 'Field Project'; // Comment1 is the arg that paypal pro uses.
}
// apply to form 2 only
if ( 2 == $form_id ) { // Replace '2' with your form id
$args["COMMENT1"] = 'Help Us Grow';
}
// always return the args, even if not changing anything
return $args;
}
Adding the global $blog_id
line makes this WP value available to the function. As you know, it stores the site ID# in a multi-site install, allowing you to apply your filter on specific sites in your network.
The second addition is just a test of that value, written in the form of a Yoda condition. If this function is executing on any other site, the $args
array is returned unchanged.
The rest of this code is exactly as found in the answer you referenced.
NOTE: I am unable to test this right now but I will be available later if you have any problems. Cheers.