Created
October 5, 2009 09:12
-
-
Save gnuget/201994 to your computer and use it in GitHub Desktop.
Hide the posts created using a write panel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function exclude_writepanels_posts($where){ | |
global $wpdb, $parent_file; | |
if( $parent_file != 'edit.php' ) return $where; | |
if (empty($_GET['filter-posts'])){ | |
$where = $where . " AND 0 = (SELECT count($wpdb->postmeta.meta_value) | |
FROM $wpdb->postmeta WHERE $wpdb->postmeta.post_id = $wpdb->posts.ID and $wpdb->postmeta.meta_key = '_mf_write_panel_id')"; | |
} | |
return $where; | |
} | |
add_filter('posts_where', 'exclude_writepanels_posts'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment