Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!is_singular('videos')) {
- add_filter('posts_where','posts_where',10,2);
- }
- function posts_where($where,$query) {
- global $wpdb, $wp_query;
- if (!is_admin()) {
- if ($query->query_vars['post_type'] == 'videos') {
- $new_where = "({$wpdb->postmeta}.meta_key = 'videoid' AND {$wpdb->postmeta}.meta_value != '')";
- if (empty($where))
- $where = $new_where;
- else
- $where = "{$where} AND {$new_where}";
- }
- }
- return $where;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement