Contact Form 적용해보았습니다.
비회원은 입력해야 하지만....
회원은 이름, 이메일, 휴대전화 값은 자동으로 가져와야 할것 같은데요... 수정방법이 쉬우면 알려주시구요 어렵다면 다음 업데이트시 꼭 적용해주셨으면 합니다.
안녕하세요~^^
1. FTP로 접속해서 /wp-content/plugins/kboard/skin/contact-form/editor.php 파일에
아래의 코드를 찾아서
<input type="hidden" name="password" value="<?php echo uniqid()?>">
찾은 코드 밑에 아래의 코드의 추가해보세요.
<?php
if(is_user_logged_in()){
$contact_user = get_userdata(get_current_user_id());
}
?>
2. 아래의 코드를 찾아서
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-member-display"><?php echo __('Name', 'kboard')?> <span class="attr-required-text">*</span></label>
<div class="attr-value"><input type="text" id="kboard-input-member-display" name="member_display" value="<?php echo $content->member_display?>" placeholder="<?php echo __('Name', 'kboard')?>..."></div>
</div>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-email-display"><?php echo __('Email', 'kboard')?> <span class="attr-required-text">*</span></label>
<div class="attr-value"><input type="email" id="kboard-input-email-display" name="kboard_option_email" value="<?php echo $content->option->email?>" placeholder="<?php echo __('Email', 'kboard')?>..."></div>
</div>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-tel-display"><?php echo __('Phone number', 'kboard')?></label>
<div class="attr-value"><input type="text" id="kboard-input-tel-display" name="kboard_option_tel" value="<?php echo $content->option->tel?>" placeholder="<?php echo __('Phone number', 'kboard')?>..."></div>
</div>
<div class="kboard-attr-row kboard-attr-title">
<label class="attr-name" for="kboard-input-title"><?php echo __('Title', 'kboard')?> <span class="attr-required-text">*</span></label>
<div class="attr-value"><input type="text" id="kboard-input-title" name="title" value="<?php echo $content->title?>" placeholder="<?php echo __('Title', 'kboard')?>..."></div>
</div>
아래의 코드로 교체해보세요.
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-member-display"><?php echo __('Name', 'kboard')?> <span class="attr-required-text">*</span></label>
<div class="attr-value"><input type="text" id="kboard-input-member-display" name="member_display" value="<?php if($contact_user): echo $contact_user->display_name; endif?>" placeholder="<?php echo __('Name', 'kboard')?>..."></div>
</div>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-email-display"><?php echo __('Email', 'kboard')?> <span class="attr-required-text">*</span></label>
<div class="attr-value"><input type="email" id="kboard-input-email-display" name="kboard_option_email" value="<?php if($contact_user): echo $contact_user->user_email; endif?>" placeholder="<?php echo __('Email', 'kboard')?>..."></div>
</div>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-tel-display"><?php echo __('Phone number', 'kboard')?></label>
<div class="attr-value"><input type="text" id="kboard-input-tel-display" name="kboard_option_tel" value="<?php if($contact_user): echo $contact_user->phone; endif?>" placeholder="<?php echo __('Phone number', 'kboard')?>..."></div>
</div>
위 코드에서 $contact_user->phone 부분에서 phone은 실제 휴대폰 번호 필드의 Meta Key 값으로 변경해주세요.
Meta Key 값은 WP-Members 플러그인의 필드 관리 페이지에 나와있습니다.
고맙습니다.