Page 1 of 1

List category posts plugin

PostPosted: November 3rd, 2011, 10:31 am
by sunriseweb
Hi,
I am using the "List category posts" plugin by Fernando Briano (http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/), and the protected posts are not being filtered out.

I do have "Filter ALL WordPress® queries; protecting all Alternative Views." checked off.

This plugin uses "get_posts" to retrieve the posts to display in the class "CatList" using the private function "lcp_set_categories" (i.e. where the arguments for get_posts are set).

Not sure if I can add "attach_s2member_query_filters();" to the List category posts plugin code to filter out the protected posts or not.

Thanks,
Brad

Re: List category posts plugin

PostPosted: November 3rd, 2011, 10:55 am
by sunriseweb
Figured it out. I edited the "List category posts" plugin "custom template" I made and used the is_protected_by_s2member() function - works like a charm - and it covers off cases where the post is in a protected category, etc. (not just limited to cases where the post itself is explicitly protected).

e.g.
if(!is_protected_by_s2member($single->ID)) {
//build post display
}

Re: List category posts plugin

PostPosted: November 3rd, 2011, 11:13 am
by Eduan
Okay, well glad you figured it our.

Re: List category posts plugin

PostPosted: November 3rd, 2011, 11:57 pm
by Cristián Lávaque
sunriseweb wrote:Figured it out. I edited the "List category posts" plugin "custom template" I made and used the is_protected_by_s2member() function - works like a charm - and it covers off cases where the post is in a protected category, etc. (not just limited to cases where the post itself is explicitly protected).

e.g.
if(!is_protected_by_s2member($single->ID)) {
//build post display
}


Great! Glad you sorted it out and thanks for sharing your solution with the rest. :)