Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何检查帖子元字段是否等于“posts_where”过滤器中的某些内容?我想跳过自定义字段“my_meta_box_check”设置为“off”的帖子。
谢谢!
你可以这样做:
function filter_where( $where = '' ) { global $wpdb; $where .= " AND ($wpdb->postmeta.meta_key = 'my_meta_box_check' AND $wpdb->postmeta.meta_value = 'off')"; return $where; }