Your cart is currently empty!
Defaulting new posts and media uploads to use “Registered” group
—
by
Hi,
I’m setting up a “private” self-hosted WordPress site to share my photos and videos with family and friends. I’ve managed to purchase and install the Widget Control Pro and Groups plugins, and have been able to apply the use of groups to successfully to restrict my posts and media attachment page content from the Internet at large. I’m aware the direct media URLs are unprotected at with this scheme, but they can’t really be guessed externally, and it does allow me easily share a specific image/video with un-registered individuals.
So in a nutshell, “all good.” However, this scheme implies that I need to remember to always manually assign at least one group ID to every post and media file, lest it remain unprotected. To avoid the potential for mishap — is there any way to configure the system to automatically apply the built-in “Registered” group ID for every new post and media upload?
J. Wilson
Comments
3 responses to “Defaulting new posts and media uploads to use “Registered” group”
Hi Jason,
You can use the Groups API and this code as reference (you need to change the $group_id).
Kind Regards,
Antonio B.
Thanks for the quick reply, Antonio! The code example that you linked appears to handle the “new post” use case. Can you offer guidance on how to similarly address any/all new media uploads as well?
Jason
Hi Jason,
something like this should work: https://gist.github.com/eggemplo/e69d3d46298acd95127f575e510bc9eb
Kind Regards,
Antonio B.