Sometimes, you may find that you want to add or remove fields from the registration form based on the page you are on. This may be the case if you set up different registration pages, or you might want to have a specific registration page with certain fields and the automatic forms that show on blocked content have different fields. There are many ways to approach it, but ultimately, it is very simple to add or remove fields from the form with the wpmem_fields
filter.
Tips and Tricks
Redirect blocked content to a login page
While the WP-Members plugin is built to automatically replace blocked content with a login and registration form, sometimes it is necessary to redirect blocked content to a specific login page. This is generally the case with builder plugins (unless you refilter the content), or plugins that use post meta for displaying extra content, such as WooCommerce, Calendar/Event plugins, etc.
This post covers some a basic way to provide the same user experience as the default setup, but by redirecting the blocked content to a login page. Continue Reading →
Remove WP-Members database entries
Sometimes it may be necessary to remove all WP-Members entries in the database. While the plugin can generally clean up after itself using the “delete” option in the WP Plugins panel, this essentially removes settings information. There are some additional entries that may be left behind depending on your configuration. This includes some user meta data, and if membership products are used, some post meta data. Continue Reading →
Display form rows in columns
This tutorial will address the common question, “How do I layout the form in columns?”
Let me say that this tutorial is one of those that is a “guideline,” not an exact science. That is due to the number of different variables that cannot be controlled. So for best chance of success, I recommend that you start with the basic process exactly as in the example. Try to reproduce that first so that you understand what it is doing before moving on to something complicated.
The following is a discussion of the the exact code snippets that I used in this demo (which also uses the code snippets for assigning placeholders to the fields and removing labels).
Continue Reading →How to bulk activate all users on an existing site
A question that comes up from time to time is how to implement moderated registration on an existing site with current users. There is no difference between an “existing” user and a “new” user – they are all simply “users,” so there isn’t a way for the plugin to know who you want to activate and who you don’t.
One particular problem, though, is that when you activate a user it will send the user a notification that they have been activated and if current settings are to send the user their initial password, their password will be set upon activation (thus changing an existing user’s password if you activate them).
Continue Reading →