@@ -563,13 +563,19 @@ function kkd_pff_paystack_fetch_plan($code){
563563}
564564function kkd_pff_paystack_form_shortcode ($ atts ) {
565565 ob_start ();
566- if ( is_user_logged_in () ) {
567- $ user_id = get_current_user_id ();
568- }else {
569- $ user_id = 0 ;
570- }
571566
572- extract (shortcode_atts (array (
567+ global $ current_user ;
568+ // wp_get_current_user();
569+ $ user_id = $ current_user ->ID ;
570+ $ email = $ current_user ->user_email ;
571+ $ fname = $ current_user ->user_firstname ;
572+ $ lname = $ current_user ->user_lastname ;
573+ if ($ fname == '' && $ lname == '' ) {
574+ $ fullname = '' ;
575+ }else {
576+ $ fullname = $ fname .' ' .$ lname ;
577+ }
578+ extract (shortcode_atts (array (
573579 'id ' => 0 ,
574580 ), $ atts ));
575581 if ($ id != 0 ) {
@@ -600,13 +606,25 @@ function kkd_pff_paystack_form_shortcode($atts) {
600606 echo '<div class="span12 unit">
601607 <label class="label">Full Name <span>*</span></label>
602608 <div class="input">
603- <input type="text" name="pf-fname" placeholder="First & Last Name" required>
609+ <input type="text" name="pf-fname" placeholder="First & Last Name" value=" ' . $ fullname . '"
610+ ' ;
611+ if ($ loggedin == 'yes ' ){
612+ echo 'readonly ' ;
613+ }
614+
615+ echo ' required>
604616 </div>
605617 </div> ' ;
606618 echo '<div class="span12 unit">
607619 <label class="label">Email <span>*</span></label>
608620 <div class="input">
609- <input type="email" name="pf-pemail" placeholder="Email Address" id="pf-email" required>
621+ <input type="email" name="pf-pemail" placeholder="Enter Email Address" id="pf-email" value=" ' . $ email . '"
622+ ' ;
623+ if ($ loggedin == 'yes ' ){
624+ echo 'readonly ' ;
625+ }
626+
627+ echo ' required>
610628 </div>
611629 </div> ' ;
612630 echo '<div class="span12 unit">
0 commit comments