If you’d like to make the content on your site visible only to certain users using categories, look no further!
Designate certain categories as “members-only” via Privacy Settings.
An administrator may then assign a user to them via Profile.
Only content belonging to “public” categories (any top-level category you do not designate as “members-only”), and categories assigned to the logged-in user, and all subcategories of either, will be visible.
I would like to thank the action hook pre_get_posts, without which this plugin would not have been possible.
This plugin was created by firstname.lastname@example.org
We’re an online marketing strategy / custom web and mobile development agency in Philadelphia.
Among other things, we love WordPress.
- If “User Access Manager” exists, why must this plugin also exist?
While User Access Manager is a fine plugin, it may be cumbersome to grant access to one or more user groups upon editing each and every post.
By contrast, with this plugin, you need only consider a category as “members-only,” and any content created within it will automaticaly be viewable only to those users assigned to it.
If you’d like to redirect a user to a different page upon logging in, instead of Profile, you might try WordPress Login Redirect or something similar.
Specify hide_empty argument (set to false) in call to get_categories, so that ALL top-level categories are shown.
Added logic to pre_get_posts hook to return $query as-is when $query->query_vars[ ‘suppress_filters’ ] is set and true.
- Add empty callback function ‘o3_moc_edit_categories’, referenced in add_settings_section( ).
- Initial release.