@@ -259,6 +259,7 @@ function kkd_pff_paystack_editor_add_extra_metaboxes() {
259259 add_meta_box ('kkd_pff_paystack_editor_add_email_data ' , 'Email Receipt Settings ' , 'kkd_pff_paystack_editor_add_email_data ' , 'paystack_form ' , 'normal ' , 'default ' );
260260 add_meta_box ('kkd_pff_paystack_editor_add_quantity_data ' , 'Quantity Payment ' , 'kkd_pff_paystack_editor_add_quantity_data ' , 'paystack_form ' , 'side ' , 'default ' );
261261 add_meta_box ('kkd_pff_paystack_editor_add_agreement_data ' , 'Agreement checkbox ' , 'kkd_pff_paystack_editor_add_agreement_data ' , 'paystack_form ' , 'side ' , 'default ' );
262+ add_meta_box ('kkd_pff_paystack_editor_add_subaccount_data ' , 'Sub Account ' , 'kkd_pff_paystack_editor_add_subaccount_data ' , 'paystack_form ' , 'side ' , 'default ' );
262263
263264 }
264265
@@ -414,6 +415,22 @@ function kkd_pff_paystack_editor_add_agreement_data() {
414415 echo '<p>Agreement Page Link:</p> ' ;
415416 echo '<input type="text" name="_agreementlink" value=" ' . $ agreementlink . '" class="widefat" /> ' ;
416417
418+ }
419+ function kkd_pff_paystack_editor_add_subaccount_data () {
420+ global $ post ;
421+
422+ // Noncename needed to verify where the data originated
423+ echo '<input type="hidden" name="eventmeta_noncename" id="eventmeta_noncename" value=" ' .
424+ wp_create_nonce ( plugin_basename (__FILE__ ) ) . '" /> ' ;
425+
426+ // Get the location data if its already been entered
427+ $ subaccount = get_post_meta ($ post ->ID , '_subaccount ' , true );
428+
429+
430+ if ($ subaccount == "" ) {$ subaccount = '' ;}
431+ echo '<p>Sub Account code:</p> ' ;
432+ echo '<input type="text" name="_subaccount" value=" ' . $ subaccount . '" class="widefat" /> ' ;
433+
417434 }
418435 function kkd_pff_paystack_save_data ($ post_id , $ post ) {
419436
@@ -447,6 +464,7 @@ function kkd_pff_paystack_save_data($post_id, $post) {
447464
448465 $ form_meta ['_useagreement ' ] = $ _POST ['_useagreement ' ];
449466 $ form_meta ['_agreementlink ' ] = $ _POST ['_agreementlink ' ];
467+ $ form_meta ['_subaccount ' ] = $ _POST ['_subaccount ' ];
450468
451469 // Add values of $form_meta as custom fields
452470
0 commit comments