2011-12-23 64 views

回答

2

你能做到像这样:

function filter_where($where = '') { 
    global $wpdb; 
    $where .= " AND ($wpdb->postmeta.meta_key = 'my_meta_box_check' AND $wpdb->postmeta.meta_value = 'off')"; 
    return $where; 
} 
+0

它现在不显示任何职位。即使'$ where。=“AND($ wpdb-> postmeta.meta_key ='my_meta_box_check')”;'不起作用:( – 2011-12-23 13:33:25

+0

Whoops - 忘记了全局引用'$ wpdb'对象,还添加了缺少的引用。 – Pat 2011-12-23 13:35:17

+0

已经发现了这些,但仍然没有工作 – 2011-12-23 13:39:44