This is a tutorial article on how to customize the profile links for the logged in state of the [wpmem_profile] shortcode. We will focus on different ways to approach it, all of which use the wpmem_member_links_args filter hook.
Tips and Tricks
Add or remove fields based on page
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.
Redirect blocked content to a login page
The default configuration of the WP-Members plugin automatically replaces blocked content with a login and registration form. This works well for standard WordPress content, but 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 →