This filter is run when determining whether a user can access any content that is restricted by WP Fusion. You can use it to create your own dynamic access rules based on criteria that aren’t available through WP Fusion’s meta boxes. To use the code examples below, add them to your active theme’s functions.php file.


  • $can_access: This variable represents whether or not the user can access the content, as determined by your existing access rules. It will either be true or false.
  • $user_id: ID of the current logged in user. Will be false if the user isn’t logged in.
  • $post_id: Post ID for the post being requested.


Deny access to posts within a certain category

The example below will allow access to posts in the category “My Category” only to users who have the tag “Special Tag”.

function restrict_post_categories( $can_access, $user_id, $post_id ) {
	if ( in_category( 'My Category', $post_id ) && ! wp_fusion()->user->has_tag( 'Special Tag', $user_id ) ) {
		return false;
	} else {
		return true;


add_filter( 'wpf_user_can_access', 'restrict_post_categories', 10, 3 );