[英]wordpress plugin function that will return the character count of the post being saved
[英]Cat + Tag Filter Plugin for WordPress: Checkboxes not being saved
我正在為WordPress使用Cat +標簽過濾器插件,它可以正常工作,除了應該保存標簽搜索之間應該保存的復選框。 除了最后一個選中的所有選項都被清除,導致我懷疑foreach語句中有錯誤顯示每個復選框並檢查標記是否包含在標記數組中。
我的問題是,如何檢查標簽復選框,而不僅僅是最后一個,這個foreach語句有什么問題嗎?
if ($type == 1){
if ($there_are_tags){
$options .= '<ul>';
foreach ($tags as $tag) {
$options .= '<li>';
$options .= '<input type="checkbox" name="';
$options .= "tag[]";
$options .= '" value="' . $tag->slug . '"';
if (is_array($current_tax['tags'])) {
if (in_array($tag->slug, $current_tax['tags'])) {
$options .= ' checked ';
}
}
$options .= '>';
$options .= $tag->name;
if ($ctf_options['tags_count'] == 1) $options .= ' (' . $tag->count . ')';
$options .= '</li>';
}
$options .= '</ul>';
}
else $options .= '<ul><li><input type="checkbox" name="tag[]" value="-1" disabled>' . __('No tags here', 'cat-tag-filter') . '</li></ul>';
}
不幸的是,這個插件有一個很好的文檔列表,而插件創建者的響應率並不是很好。 最近關於該插件的一些帖子說它在Wordpress 3.6中根本不起作用。 您的選擇是有限的,您可以在問題上給予獎勵並嘗試吸引一些針對插件的問題進行自定義修復,您可以堅持插件更新或者您可以嘗試實現像Isoptope for Wordpress (這有一點學習曲線可供使用)。
最后,我剛剛發現,如果您安裝了Yoast或Pretty Permalinks插件,則會記錄與這些插件和Cat + Tags過濾器的沖突,因此您可以嘗試打開和關閉一些插件以查看是否可以解決此問題您。
我希望這會有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.