조언이 필요합니다. 단일 게시판에 기부 양식을 삽입하기 위해 플러그인 개발자가 다음 코드를 제공했지만 작성자 주소를 통해 게시자의 이메일 주소를 자동으로 가져 오려면 paypal 주소가 필요합니다. 이것이 가능한가?이 삽입 기능을 함수에서 사용할 수 있습니까? 메타를 다른 문자열에 삽입 하시겠습니까?
function multiple_paypal_accounts($paypal_args, $payment_data) {
$form_id = isset($payment_data['post_data']['the-form-id']) ? $payment_data['post_data']['the-form-id'] : '';
if('3830' === $form_id) {
// Here I want to customize the email address to show the post author's paypal email address
$paypal_args['business'] = 'THIS IS WHERE I NEED TO PULL IN THE PAYPAL ADDRESS FROM AUTHOR META DATA';
}
// Always return the paypal args.
return $paypal_args;
}
add_filter('the_form_paypal_redirect_args', 'multiple_paypal_accounts', 10, 2);
나의 추측은 다음과 같을 것이다 : global $ post; $ author_id = $ post-> post_author; $ author_email = get_the_author_meta ('email', $ author_id); – Stender