latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Filtering Query by Custom Capabilities

Home Forums Community Forum Filtering Query by Custom Capabilities

This topic contains 3 replies, has 3 voices. Last updated by  Jason (Lead Developer) 3 years, 10 months ago.

Topic Author Topic
Posted: Wednesday Feb 27th, 2013 at 7:04 pm #43353
Chase Rief
Username: riefmedia

Hello there!

Thanks for your wonderful plugin!

I have a question regarding the filtering of WordPress Queries for Custom Post Types.

If i use Custom Capabilities for my custom posts types, the posts are still showing up in the query even if the current user doesn’t have the required Capability assigned to his account.

I am filtering all WordPress Queries in “Restriction Options > Alternative View Protection“.

I tried to filter the query by using

attach_s2member_query_filters()

, but it doesn’t work.

For regular posts, the filtering of Custom Post Types works just fine – the issue occurs only when using custom post types.

Any other way to hide those posts from the users not having the required credentials?

Thanks a lot!

  • This topic was modified 3 years, 10 months ago by  Chase Rief. Reason: the filtering works for regular posts, but not for custom post types

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Saturday Mar 2nd, 2013 at 4:30 am #43574

Hi Chase.

I’ll have to ask Jason about this one. I’m leaving him a message now and I’ll let you know as soon as I hear back from him. Thanks for your patience.

In the meantime, could you please post more info about what you tried? Could you explain where you used [hilite mono]attach_s2member_query_filters()[/hilite]? And could you submit your site’s info so Jason can take a look at your installation in case it’s needed? s2Member® » Private Contact Form

And just to rule out a theme/plugin conflict, could you test your theme and plugins to see if that’s not the source of the problem? See: Knowledge Base » Common Troubleshooting Tips.

Thanks!

Posted: Saturday Mar 2nd, 2013 at 4:55 pm #43637
Staff Member

Thanks for your inquiry. ~ We appreciate your patience :-)

s2Member® does support Custom Post Types through Alt View Restrictions; so I’d like to find out more about why this is causing trouble for you. So far I’ve been unable to reproduce this behavior.

How have you protected your Custom Post Type content exactly with s2Member?
Through Post Access Restrictions, URI Restrictions, or how exactly? Thanks!

I would also run a quick test to be sure this function is working properly on your installation.

Posted: Saturday Mar 2nd, 2013 at 4:56 pm #43638
Staff Member

Also, are you dealing with a custom template (i.e. custom PHP code)?
If so, what WordPress® function is being used to query posts? Please show some example code. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.