Created
August 6, 2009 06:48
-
-
Save gnuget/163181 to your computer and use it in GitHub Desktop.
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
#getting all posts related with a write panel in magicfields | |
select * from wp_posts where wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'future' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'private') AND 0 < (SELECT count(wp_postmeta.meta_value) FROM wp_postmeta WHERE wp_postmeta.post_id = wp_posts.ID and wp_postmeta.meta_key = '_rc_cwp_write_panel_id' and wp_postmeta.meta_value = '{$write_panel_id}'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment