옵션 필드에 비밀, 공지사항 2가지외 혹시 다른것도 더 추가해서 할수 없습니다
예제 비밀, 공지사항, 홍길동, 홈길동2, 이렇게 추가해서 할수 없습니까?
방법 알려주세요!
아무련 변화가 없습니다 ~
ㅠㅠ
안녕하세요~^^
아래의 코드를 참고하여
테마 function.php에 코드를 입력해보시겠어요?
add_filter('kboard_get_template_field_html', 'my_kboard_get_template_field_html', 10, 4);
function my_kboard_get_template_field_html($layout, $field, $content, $board){
if(in_array($board->id, array('1'))){
$fields = $board->fields();
$boardBuilder = new KBoardBuilder($board->id);
$meta_key = (isset($field['meta_key']) && $field['meta_key']) ? $field['meta_key'] : '';
$field_name = (isset($field['field_name']) && $field['field_name']) ? $field['field_name'] : $field['field_label'];;
if(isset($field['meta_key']) && $field['meta_key'] == 'option'){
ob_start();
?>
<div class="kboard-attr-row <?php echo esc_attr($field['class'])?>">
<label class="attr-name" for="<?php echo esc_attr($meta_key)?>"><span class="field-name"><?php echo esc_html($field_name)?></span></label>
<div class="attr-value">
<?php if($fields->isUseFields($field['secret_permission'], $field['secret'])):?>
<label class="attr-value-option"><input type="checkbox" name="secret" value="true" onchange="kboard_toggle_password_field(this)"<?php if($content->secret):?> checked<?php endif?>> <?php echo __('Secret', 'kboard')?></label>
<?php endif?>
<?php if($fields->isUseFields($field['notice_permission'], $field['notice'])):?>
<label class="attr-value-option"><input type="checkbox" name="notice" value="true"<?php if($content->notice):?> checked<?php endif?>> <?php echo __('Notice', 'kboard')?></label>
<?php endif?>
<?php do_action('kboard_skin_editor_option', $content, $board, $boardBuilder)?>
<?php if(isset($field['description']) && $field['description']):?><div class="description"><?php echo esc_html($field['description'])?></div><?php endif?>
<label class="attr-value-option"><input type="checkbox" name="kboard_option_메타키" value="true"<?php if($content->option->메타키):?> checked<?php endif?>> 옵션 추가</label>
</div>
</div>
<?php
$layout = ob_get_clean();
}
}
return $layout;
}
고맙습니다.