Depending on how the plugin gets used, sometimes the <legend> tag for the form is not needed. For example, if you have created a login page with the page title “Login”, you do not really need the form to also carry the same text. Here are some generic utility snippets you can use to remove these various headings. Continue Reading →
Filters
Modifying default error messages that are not editable in the dialogs tab
When I first developed the admin panels for the plugin, I added editable dialogs for most of the various error messages. Since then, some additional dialogs have been added for form validation (as well as the ability to add your own validation and messages). However, most of those were not included in the dialogs tab. This is mainly because it does take quite a bit of programming overhead and more system resources for adding this as a feature.
So what if you want to change one of these messages? For example, you would like to change the message “The username cannot include non-alphanumeric characters” to something more light hearted, such as “Like, no weird characters in the username, dude!” This code snippet collects a number of these default message strings and allows you to replace them with your own versions. Continue Reading →
Reset password with just email
NOTE: if you are using version 2.9+, there is a new set of code snippets using some new filter hooks that make this process easier.
One of the requests I get most often is how can I change the plugin to have the password reset only require the user to give their email address. This especially comes up when people customize the process to use the person’s email address as their username, since a password reset form with “username” and “email” doesn’t make much sense in that situation.
Well, since version 2.8.5, there has been a filter hook in the password reset process that allows you to filter the arguments that are passed in order to reset the user’s password – wpmem_pwdreset_args. There are two stages to this demonstration, and thus two parts of the code snippet. First, we only need a form requesting the user’s email, so we will remove the “username” field from the form. Second is filtering the arguments of the password reset process so that the user’s password can be reset with only the email provided. Continue Reading →
Creating menus for different user roles
We’ve had some different tutorials on displaying menus based on login status – showing a different menu for logged in users vs. non-users. I also put together a code snippet and a plugin extension to automate this process. There’s even a tutorial on how to remove menu items based on login status.
This tutorial is an extension of those concepts to display different menus based not only on logged in status, but also a user’s role. Continue Reading →
Multiple Selection Checkboxes – Add A Section Heading (Advanced)
This tutorial is an extension of the tutorial on creating Multiple Selection Checkboxes. This tutorial will add a little snippet to one of the functions in that tutorial to show you how to add a section heading to your group of checkboxes.
The end result is to have a heading for the group of checkboxes, followed by the checkboxes with the label text to the right, much like this screenshot.
This is a slightly more advanced tutorial that the previous basic tutorial. You might try that one first.
While not overly complicated, I will work through the process step-by-step so that it is easier to understand what each section does. Continue Reading →