function my_kboard_list_from($from, $board_id, $content_list){
if($board_id == '6'){
global $wpdb;
$from = "`{$wpdb->prefix}kboard_board_content` LEFT JOIN `{$wpdb->prefix}kboard_board_option` ON `{$wpdb->prefix}kboard_board_content`.`uid`=`{$wpdb->prefix}kboard_board_option`.`content_uid`";
}
return $from;
}
add_filter('kboard_list_from', 'my_kboard_list_from', 10, 3);
function my_kboard_list_where($where, $board_id, $content_list){
if($board_id == '6'){
global $wpdb;
$meta_key = 'bookyear';
$where .= " AND (`option_key`='{$meta_key}' )";
}
return $where;
}
add_filter('kboard_list_where', 'my_kboard_list_where', 10, 3);
function my_kboard_list_orderby($order, $board_id, $content_list){
if($board_id == '6'){
global $wpdb;
$order = "`{$wpdb->prefix}kboard_board_option`.`option_value` DESC";
}
return $order;
}
add_filter('kboard_list_orderby', 'my_kboard_list_orderby', 10, 3);
위 소스대로 정렬한뒤에 커스텀 필드 검색시 리스트가 안나타나는 현상이 발견됩니다.
왜 이럴까요?
추가 이미지 넣어드립니다.
https://imgur.com/NbvI4oT
안녕하세요~^^
검색 입력 필드에 입력 후 검색 버튼을 누르시면
게시글 목록에 아무것도 표시되지 않는다는 말씀이신지요?
해당 코드를 저희 쪽 테스트 서버에서 확인해보니
전체, 제목, 내용, 작성자로 정상적으로 검색이 되는 것을 확인했습니다.
좀 더 구체적인 상황을 설명해주시겠어요?
고맙습니다.
기본적인 키워드 검색으로는 가능하지만 커스텀한 필드 기준으로 검색시 이상이 리스트에 아무것도 표시되지 않습니다.
이미지 링크 드린것을 참고로 보시면 조금 이해되실 것 같네요.
<?php $kboard_search_option = kboard_search_option()?>
<input type="hidden" name="kboard_search_option[address][key]" value="address">
<input type="hidden" name="kboard_search_option[address][compare]" value="LIKE">
<input type="hidden" name="kboard_search_option[address][wildcard]" value="both">
<input type="text" name="kboard_search_option[address][value]" value="<?php echo isset($kboard_search_option['address']['value']) ? $kboard_search_option['address']['value'] : ''?>" placeholder="address 옵션 필드 검색">
이 내용을 참고하여 제작 하였습니다.
kboard_search_option() 함수로 kboard_option 값을 가져올 수 있습니다.
추가하신 각 필터에 kboard_search_option() 함수로 kboard_option 값이 있는지 체크해서 적용해주셔야 할 듯합니다.
kboard_search_option() 함수는
FTP로 접속해서 /wp-content/plugins/kboard/helper/Functions.helper.php 파일에서 확인 가능합니다.
입력 필드 검색 방법은 아래의 링크를 참고해보시겠어요?
KBoard(케이보드) 입력 필드 검색 방법 - 워드프레스 게시판 커스터마이징
고맙습니다.
array(3) { ["relation"]=> string(3) "AND" ["inquiry_type"]=> array(4) { ["key"]=> string(12) "inquiry_type" ["compare"]=> string(4) "LIKE" ["wildcard"]=> string(4) "both" ["value"]=> string(0) "" } ["bookyear"]=> array(4) { ["key"]=> string(8) "bookyear" ["compare"]=> string(4) "LIKE" ["wildcard"]=> string(4) "both" ["value"]=> string(0) "" } }
아무 것도 검색 내용이 없을시 나타나는 값이구요.
array(3) { ["relation"]=> string(3) "AND" ["inquiry_type"]=> array(4) { ["key"]=> string(12) "inquiry_type" ["compare"]=> string(4) "LIKE" ["wildcard"]=> string(4) "both" ["value"]=> string(12) "학술총서" } ["bookyear"]=> array(4) { ["key"]=> string(8) "bookyear" ["compare"]=> string(4) "LIKE" ["wildcard"]=> string(4) "both" ["value"]=> string(4) "2020" } }
값을 넣었을시 나타나는 경우인데 kboard_option 값은 있습니다.
확인해보니 inquiry_type의 값만 들어가는 순간 리스트상에서 아무것도 안나오더라고요.. 이제 무슨 문제일까요.
inquiry_type은 입력 필드의 메타키 입니다.
게시글 등록 시 입력 필드의 메타키가 inquiry_type인 필드가 있는지 확인해보시겠어요?
고맙습니다.
inquiry_type 같은 경우는 현재 셀렉트이며, 입력필드는 아닌데 이게 문제일까요...?
list.php에 <?php echo $content->option->inquiry_type?> 를 찍어보니 제대로 값은 나왔습니다.
설마싶어서 위에 이미지보여드립니다.
ㅠㅠ url을 드리고싶지만 망자체가 보안망이라 불가능한점 이해부탁드리겠습니다.
테마 쪽에 추가한 코드를 지우신 상태에서는 정상적으로 동작하는지요?
스킨의 editor.php에 추가하신 코드도 올려주시겠어요?
고맙습니다.
1. 테마쪽에서 function.php 의 내용을 지우면 정상적으로 게시물 검색은 가능합니다.
2. function.php를 입력하면 검색쪽의 제목, 내용, 작성자 검색만 가능하고 커스텀필드의 검색은 불가능합니다.
3. list.php 소스
<div id="kboard-post-gallery-list">
<!-- 검색폼 시작 -->
<div class="kboard-post-gallery-search">
<form id="kboard-search-form-<?php echo $board->id?>" method="get" action="<?php echo $url->toString()?>">
<div class="word-wrap1">
<strong>검색어</strong>
<?php echo $url->set('pageid', '1')->set('target', '')->set('keyword', '')->set('mod', 'list')->toInput()?>
<select name="target">
<option value="title" <?php if(kboard_target() == 'title'):?> selected<?php endif?>><?php echo __('Title', 'kboard')?></option>
<option value="content" <?php if(kboard_target() == 'content'):?> selected<?php endif?>><?php echo __('Content', 'kboard')?></option>
<option value="member_display" <?php if(kboard_target() == 'member_display'):?> selected<?php endif?>><?php echo __('Author', 'kboard')?></option>
</select>
<input type="text" name="keyword" value="<?php echo kboard_keyword()?>" />
</div>
<div class="word-wrap2">
<strong>간행물 종류</strong>
<?php $kboard_search_option = kboard_search_option()?>
<?php $inquiry_type = isset($kboard_search_option['inquiry_type']['value']) ? $kboard_search_option['inquiry_type']['value'] : '';?>
<input type="hidden" name="kboard_search_option[inquiry_type][key]" value="inquiry_type" />
<input type="hidden" name="kboard_search_option[inquiry_type][compare]" value="LIKE" />
<input type="hidden" name="kboard_search_option[inquiry_type][wildcard]" value="both" />
<select name="kboard_search_option[inquiry_type][value]">
<option value="">간행물 종류</option>
<option value="학술총서" <?php if($inquiry_type == '학술총서'):?> selected<?php endif?>>학술총서</option>
<option value="발굴보고서" <?php if($inquiry_type == '발굴보고서'):?> selected<?php endif?>>발굴보고서</option>
</select>
</div>
<div class="word-wrap3">
<strong>발행년도</strong>
<input type="hidden" name="kboard_search_option[bookyear][key]" value="bookyear" />
<input type="hidden" name="kboard_search_option[bookyear][compare]" value="LIKE" />
<input type="hidden" name="kboard_search_option[bookyear][wildcard]" value="both" />
<input type="text" name="kboard_search_option[bookyear][value]" value="<?php echo isset($kboard_search_option['bookyear']['value']) ? $kboard_search_option['bookyear']['value'] : ''?>" />
<span>예)2020</span>
</div>
<button type="submit"class="kboard-post-gallery-button-small"><?php echo __('Search', 'kboard')?></button>
<div>
</div>
</form>
</div>
<!-- 검색폼 끝 -->
<!-- 카테고리 시작 -->
<?php
if($board->use_category == 'yes'){
if($board->isTreeCategoryActive()){
$category_type = 'tree-select';
}
else{
$category_type = 'default';
}
$category_type = apply_filters('kboard_skin_category_type', $category_type, $board, $boardBuilder);
echo $skin->load($board->skin, "list-category-{$category_type}.php", $vars);
}
?>
<!-- 카테고리 끝 -->
<!-- 리스트 시작 -->
<div class="kboard-list-cnt">
<ul>
<li>총게시물 : <span><?php echo $list->total ?></span></li>
<li>현재 페이지 : <span><?php echo $list->page ?></span></li>
<li>전체 페이지 : <span><?php echo ceil($list->total/$list->rpp) ?></span></li>
</ul>
</div>
<ul class="kboard-post-gallery-list">
<?php while($content = $list->hasNextNotice()):?>
<li class="kboard-list-item<?php if($content->uid == kboard_uid()):?> kboard-list-selected<?php endif?>">
<div class="kboard-list-inner-item">
<div class="kboard-list-thumbnail">
<?php if($content->getThumbnail(500, 500)):?>
<div class="kboard-list-thumbnail-child" style="background-image:url(<?php echo $content->getThumbnail(500, 500)?>)"></div>
<?php endif?>
<?php if(isset($content->attach->file1) && $content->attach->file1[0]):?>
<div class="over_btn">
<a href="<?php echo $content->attach->file1[0]?>"><span>미리 보기</span></a>
</div>
<?php endif?>
</div>
<div class="kboard-list-thumbnail-txt">
<div class="kboard-list-title1">
<a href="<?php echo $content->attach->file1[0]?>" target="_blank"><?php echo $content->title?></a>
<p><?php echo strip_tags($content->content); ?></p>
</div>
<div class="kboard-list-date">
<p>발행연도 <?php echo $content->option->bookyear?></p>
<?php if($board->isWriter()):?>
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'editor')->toString()?>" class="kboard-post-gallery-button-small"><?php echo __('Edit', 'kboard')?></a>
<a href="<?php echo $url->getContentRemove($content->uid)?>" class="kboard-default-button-small" onclick="return confirm('<?php echo __('Are you sure you want to delete?', 'kboard')?>');"><?php echo __('Delete', 'kboard')?></a>
<?php endif?>
</div>
</div>
</div>
</li>
<?php endwhile?>
<?php while($content = $list->hasNext()):?>
<li class="kboard-list-item<?php if($content->uid == kboard_uid()):?> kboard-list-selected<?php endif?>">
<div class="kboard-list-inner-item">
<div class="kboard-list-thumbnail">
<?php if($content->getThumbnail(500, 500)):?>
<div class="kboard-list-thumbnail-child" style="background-image:url(<?php echo $content->getThumbnail(500, 500)?>)"></div>
<?php endif?>
<?php if(isset($content->attach->file1) && $content->attach->file1[0]):?>
<div class="over_btn">
<a href="<?php echo $content->attach->file1[0]?>" target="_blank"><span>미리 보기</span></a>
</div>
<?php endif?>
</div>
<div class="kboard-list-thumbnail-txt">
<div class="kboard-list-title1">
<a href="<?php echo $content->attach->file1[0]?>" target="_blank"><?php echo $content->title?></a>
<p><?php echo strip_tags($content->content); ?></p>
</div>
<div class="kboard-list-date">
<p>발행연도 <?php echo $content->option->bookyear?></p>
<?php if($board->isWriter()):?>
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'editor')->toString()?>" class="kboard-post-gallery-button-small"><?php echo __('Edit', 'kboard')?></a>
<a href="<?php echo $url->getContentRemove($content->uid)?>" class="kboard-default-button-small" onclick="return confirm('<?php echo __('Are you sure you want to delete?', 'kboard')?>');"><?php echo __('Delete', 'kboard')?></a>
<?php endif?>
</div>
</div>
</div>
</li>
<?php endwhile?>
</ul>
<!-- 리스트 끝 -->
<!-- 페이징 시작 -->
<div class="kboard-pagination">
<ul class="kboard-pagination-pages">
<?php echo kboard_pagination($list->page, $list->total, $list->rpp)?>
</ul>
</div>
<!-- 페이징 끝 -->
<div class="kboard-control">
<!-- <div class="kboard-control-search">
<a href="#" onclick="kboard_post_gallery_search_toggle();return false;" title="<?php echo __('Search', 'kboard')?>"><img src="<?php echo $skin_path?>/images/icon-search.png" alt="<?php echo __('Search', 'kboard')?>"></a>
</div> -->
<?php if($board->isWriter()):?>
<div class="kboard-control-write">
<a class="kboard-post-gallery-button-small" href="<?php echo $url->set('mod', 'editor')->toString()?>"
title="<?php echo __('New', 'kboard')?>">글쓰기</a>
</div>
<?php endif?>
</div>
<?php if($board->contribution()):?>
<?php endif?>
</div>
<?php wp_enqueue_script('post-gallery-list', "{$skin_path}/list.js", array(), KBOARD_VERSION, true)?>
4. editor.php 소스
<style>
#reviewSlider{display:none;}
</style>
<div id="kboard-post-gallery-editor">
<form class="kboard-form" method="post" action="<?php echo $url->getContentEditorExecute()?>" enctype="multipart/form-data" onsubmit="return kboard_editor_execute(this);">
<?php wp_nonce_field('kboard-editor-execute', 'kboard-editor-execute-nonce')?>
<input type="hidden" name="action" value="kboard_editor_execute">
<input type="hidden" name="mod" value="editor">
<input type="hidden" name="uid" value="<?php echo $content->uid?>">
<input type="hidden" name="board_id" value="<?php echo $content->board_id?>">
<input type="hidden" name="parent_uid" value="<?php echo $content->parent_uid?>">
<input type="hidden" name="member_uid" value="<?php echo $content->member_uid?>">
<input type="hidden" name="member_display" value="<?php echo $content->member_display?>">
<input type="hidden" name="date" value="<?php echo $content->date?>">
<input type="hidden" name="user_id" value="<?php echo get_current_user_id()?>">
<div class="kboard-attr-row kboard-attr-title">
<label class="attr-name" for="kboard-input-title"><?php echo __('Title', 'kboard')?></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>
<?php if($board->use_category):?>
<?php if($board->isTreeCategoryActive()):?>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-tree-category"><?php echo __('Category', 'kboard')?></label>
<div class="attr-value">
<?php for($i=1; $i<=$content->getTreeCategoryDepth(); $i++):?>
<input type="hidden" id="tree-category-check-<?php echo $i?>" value="<?php echo $content->option->{'tree_category_'.$i}?>">
<input type="hidden" name="kboard_option_tree_category_<?php echo $i?>" value="">
<?php endfor?>
<div class="kboard-tree-category-wrap"></div>
</div>
</div>
<?php else:?>
<?php if($board->initCategory1()):?>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-select-category1"><?php echo __('Category', 'kboard')?></label>
<div class="attr-value">
<select id="kboard-select-category1" name="category1">
<option value=""><?php echo __('Category', 'kboard')?> <?php echo __('Select', 'kboard')?></option>
<?php while($board->hasNextCategory()):?>
<option value="<?php echo $board->currentCategory()?>"<?php if($content->category1 == $board->currentCategory()):?> selected<?php endif?>><?php echo $board->currentCategory()?></option>
<?php endwhile?>
</select>
</div>
</div>
<?php endif?>
<?php if($board->initCategory2()):?>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-select-category2"><?php echo __('Category', 'kboard')?>2</label>
<div class="attr-value">
<select id="kboard-select-category2" name="category2">
<option value=""><?php echo __('Category', 'kboard')?> <?php echo __('Select', 'kboard')?></option>
<?php while($board->hasNextCategory()):?>
<option value="<?php echo $board->currentCategory()?>"<?php if($content->category2 == $board->currentCategory()):?> selected<?php endif?>><?php echo $board->currentCategory()?></option>
<?php endwhile?>
</select>
</div>
</div>
<?php endif?>
<?php endif?>
<?php endif?>
<div class="kboard-attr-row kboard-attr-username">
<label class="attr-name" for="kboard_option_plan">간행물 종류</label>
<div class="attr-value">
<select id="kboard_option_inquiry_type" name="kboard_option_inquiry_type">
<option value="">선택하세요</option>
<option value="학술총서"<?php if($content->option->inquiry_type == '학술총서'):?> selected<?php endif?>>학술총서</option>
<option value="발굴보고서"<?php if($content->option->inquiry_type == '발굴보고서'):?> selected<?php endif?>>발굴보고서</option>
</select>
</div>
</div>
<div class="kboard-attr-row kboard-attr-username">
<label class="attr-name" for="kboard_option_bookyear">발행연도</label>
<div class="attr-value"><input type="text" id="kboard_option_bookyear" name="kboard_option_bookyear" value="<?php echo $content->option->bookyear?>" placeholder="발행연도를 입력해주세요. 예) 2020"></div>
</div>
<?php if($board->viewUsernameField()):?>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-member-display"><?php echo __('Author', 'kboard')?></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 __('Author', 'kboard')?>..."></div>
</div>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-password"><?php echo __('Password', 'kboard')?></label>
<div class="attr-value"><input type="password" id="kboard-input-password" name="password" value="<?php echo $content->password?>" placeholder="<?php echo __('Password', 'kboard')?>..."></div>
</div>
<?php else:?>
<input style="display:none" type="text" name="fake-autofill-fields">
<input style="display:none" type="password" name="fake-autofill-fields">
<!-- 비밀글 비밀번호 필드 시작 -->
<div class="kboard-attr-row secret-password-row"<?php if(!$content->secret):?> style="display:none"<?php endif?>>
<label class="attr-name" for="kboard-input-password"><?php echo __('Password', 'kboard')?></label>
<div class="attr-value"><input type="password" id="kboard-input-password" name="password" value="<?php echo $content->password?>" placeholder="<?php echo __('Password', 'kboard')?>..."></div>
</div>
<!-- 비밀글 비밀번호 필드 끝 -->
<?php endif?>
<?php if($board->useCAPTCHA() && !$content->uid):?>
<?php if(kboard_use_recaptcha()):?>
<div class="kboard-attr-row">
<label class="attr-name"></label>
<div class="attr-value"><div class="g-recaptcha" data-sitekey="<?php echo kboard_recaptcha_site_key()?>"></div></div>
</div>
<?php else:?>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-captcha"><img src="<?php echo kboard_captcha()?>" alt=""></label>
<div class="attr-value"><input type="text" id="kboard-input-captcha" name="captcha" value="" placeholder="<?php echo __('CAPTCHA', 'kboard')?>..."></div>
</div>
<?php endif?>
<?php endif?>
<div class="kboard-attr-row"">
<?php if($board->use_editor):?>
<?php wp_editor($content->content, 'kboard_content', array('media_buttons'=>$board->isAdmin(), 'editor_height'=>400))?>
<?php else:?>
<label class="attr-name" for="kboard-input-captcha">간단설명</label>
<div class="attr-value"><textarea name="kboard_content" id="kboard_content" maxlength="60" placeholder="30자 이내로 작성해주세요." style="width:100%;height:53px;"><?php echo $content->content?></textarea></div>
<?php endif?>
</div>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-thumbnail"><?php echo __('Thumbnail', 'kboard')?></label>
<div class="attr-value">
<?php if($content->thumbnail_file):?><?php echo $content->thumbnail_name?> - <a href="<?php echo $url->getDeleteURLWithAttach($content->uid);?>" onclick="return confirm('<?php echo __('Are you sure you want to delete?', 'kboard')?>');"><?php echo __('Delete file', 'kboard')?></a><?php endif?>
<input type="file" id="kboard-input-thumbnail" name="thumbnail" accept="image/*">
</div>
</div>
<!-- <div class="kboard-attr-row">
<label class="attr-name" for="kboard_attach_over_image">오버레이</label>
<div class="attr-value">
<?php if(isset($content->attach->over_image)):?><?php echo $content->attach->over_image[1]?> - <a href="<?php echo $url->getDeleteURLWithAttach($content->uid, 'over_image');?>" onclick="return confirm('<?php echo __('Are you sure you want to delete?', 'kboard')?>');"><?php echo __('Delete file', 'kboard')?></a><?php endif?>
<input type="file" id="kboard_attach_over_image" name="kboard_attach_over_image" accept="image/*">
<div class="description">※ 오버레이 이미지는 리스트의 썸네일에 마우스 오버시 보여지는 이미지입니다.</div>
</div>
</div> -->
<?php if($board->meta->max_attached_count > 0):?>
<!-- 첨부파일 시작 -->
<?php for($attached_index=1; $attached_index<=$board->meta->max_attached_count; $attached_index++):?>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-file<?php echo $attached_index?>"><?php echo __('Attachment', 'kboard')?><?php echo $attached_index?></label>
<div class="attr-value">
<?php if(isset($content->attach->{"file{$attached_index}"})):?><?php echo $content->attach->{"file{$attached_index}"}[1]?> - <a href="<?php echo $url->getDeleteURLWithAttach($content->uid, "file{$attached_index}");?>" onclick="return confirm('<?php echo __('Are you sure you want to delete?', 'kboard')?>');"><?php echo __('Delete file', 'kboard')?></a><?php endif?>
<input type="file" id="kboard-input-file<?php echo $attached_index?>" name="kboard_attach_file<?php echo $attached_index?>">
</div>
</div>
<?php endfor?>
<!-- 첨부파일 끝 -->
<?php endif?>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-select-wordpress-search"><?php echo __('WP Search', 'kboard')?></label>
<div class="attr-value">
<select id="kboard-select-wordpress-search" name="wordpress_search">
<option value="1"<?php if($content->search == '1'):?> selected<?php endif?>><?php echo __('Public', 'kboard')?></option>
<option value="2"<?php if($content->search == '2'):?> selected<?php endif?>><?php echo __('Only title (secret document)', 'kboard')?></option>
<option value="3"<?php if($content->search == '3'):?> selected<?php endif?>><?php echo __('Exclusion', 'kboard')?></option>
</select>
</div>
</div>
<div class="kboard-control">
<div class="left">
<?php if($content->uid):?>
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'document')->toString()?>" class="kboard-post-gallery-button-small"><?php echo __('Back', 'kboard')?></a>
<a href="<?php echo $url->set('mod', 'list')->toString()?>" class="kboard-post-gallery-button-small"><?php echo __('List', 'kboard')?></a>
<?php else:?>
<a href="<?php echo $url->set('mod', 'list')->toString()?>" class="kboard-post-gallery-button-small"><?php echo __('Back', 'kboard')?></a>
<?php endif?>
</div>
<div class="right">
<?php if($board->isWriter()):?>
<button type="submit" class="kboard-post-gallery-button-small"><?php echo __('Save', 'kboard')?></button>
<?php endif?>
</div>
</div>
</form>
</div>
<?php wp_enqueue_script('post-gallery-script', "{$skin_path}/script.js", array(), KBOARD_VERSION, true)?>
한번 확인해주시면 감사하겠습니다.
안녕하세요.
이전 댓글에 안내해드린 것처럼
테마 쪽 functions.php 파일에 추가하신 각 필터에
kboard_search_option() 함수로 kboard_option 값이 있는지 체크해서 적용해보시겠어요?
기존 코드 대신 아래의 코드로 교체해보세요.
function my_kboard_list_from($from, $board_id, $content_list){
if($board_id == '6' && !kboard_search_option()){
global $wpdb;
$from = "`{$wpdb->prefix}kboard_board_content` LEFT JOIN `{$wpdb->prefix}kboard_board_option` ON `{$wpdb->prefix}kboard_board_content`.`uid`=`{$wpdb->prefix}kboard_board_option`.`content_uid`";
}
return $from;
}
add_filter('kboard_list_from', 'my_kboard_list_from', 10, 3);
function my_kboard_list_where($where, $board_id, $content_list){
if($board_id == '6' && !kboard_search_option()){
global $wpdb;
$meta_key = 'bookyear';
$where .= " AND (`option_key`='{$meta_key}' )";
}
return $where;
}
add_filter('kboard_list_where', 'my_kboard_list_where', 10, 3);
function my_kboard_list_orderby($order, $board_id, $content_list){
if($board_id == '6' && !kboard_search_option()){
global $wpdb;
$order = "`{$wpdb->prefix}kboard_board_option`.`option_value` DESC";
}
return $order;
}
add_filter('kboard_list_orderby', 'my_kboard_list_orderby', 10, 3);
고맙습니다.
감사합니다 적용하니 잘되네요!