Feature Requests

Got an idea for a new feature or integration? We’d love to hear it! You can find our roadmap here.

1 vote

Override access control filters

If you want to globally protect a custom post type, a category, a tag, and so on, you can use filters like wpf_post_type_rules.
However, by doing this you lose the ability to set access control for a single post that matches a global rule.
For example, you want to protect all the “course” CPT posts, but you want to let just one freely accessible. The only way seems to avoid the global filter and set the access rules on a post-basis.
Maybe a checkbox in the WP Fusion meta box can do the trick: something like “Override any other rule” or “Override global filters.”
With this option enabled, the post could be set as you want..”

Declined Category: Core Feature Enhancements Fabio Migliaccio shared this idea Updated: July 5, 2021

1 thought on “Override access control filters”

  1. Hey Fabio,

    The best filter for any type of access control is wpf_user_can_access: https://wpfusion.com/documentation/filters/wpf_user_can_access/

    That runs on everything protected by WP Fusion, and as a part of that you can check the post type, taxonomy terms, post parent, or any other variables you need.

    wpf_post_type_rules has some performance benefits for protecting an entire post type, but if we allowed individual posts to bypass the rule, then those performance benefits would be gone (it’s only good for performance because it doesn’t look at individual post IDs).

    Hope that helps clarify things 🙂

Leave a Comment

Your email address will not be published. Required fields are marked *