SQL Query Protected Post Content while logged out

Hey there,

I’m using the membership plugin, and I want to make some protected content teasers, and stats. My goal is to display some data from posts that are protected (in a protected category). I would like to display the post titles in a sidebar widget to show what you would have access to if you signed up. like a teaser.. I also need to grab some meta_key values from the protected content to build a stats table on all content, protected or not..

Problem is i need to work around membership plugin adding the parameters “ID NOT IN ( SELECT object_id FROM wp_26_term_relationships WHERE term_taxonomy_id IN (232) )” to my wp_query while I grab a little bit of info from the posts..

I’ve tried creating my own custom sql query, that queries private and publish post status’s, but the membership plugin even adds the category exclusion to my custom sql query.. totally makes sense, this way plugins etc that deal with posts also work with membership plugin and protect content..

So, I’ve tried to implement ” $user_id_temp = 2; wp_set_current_user( $user_id_temp ); ” in order to run the query as an administrator level, but this isnt carrying over to where membership is injecting the query parameters

I also use some of the post data meta_key values to do some math(mean median range etc) and come up with a stats table based on all posts data which is shown to all visitors to the blog, logged in or not.. this is running as a plugin, and it gets the membership parameters added to its query as well.. so if a visitor comes along and is not a logged in member, the plugin query only grabs half the posts (the ones that are not protected) and displays some funky misleading data.. this means that the stats table will show different things based upon wether you are a member or not… basically i need to get post data from protected posts and show it on the public side of the site to non-logged in users…

Anyway we can do this? Run an sql query past membership plugin by changing the current user id via wp_set_current_user( $user_id );, or by creating a custom sql query? perhaps using the wp_query ‘perm’ argument (which has almost nothing in the codex)?

Anyway help would rock..

-e