For WP-Members users who want to do heavy customization to the plugin’s default forms, the PHP str_replace function can be both your best friend and your arch nemesis. Continue Reading →
str_replace
Move form label for checkboxes with a filter
Suppose you want to move the text label for a checkbox the default layout of the registration form. You would like to move it to be to the right of the checkbox. How can that be done?
The WP-Members registration form has a basic default layout. This is necessary for it to be functional in a wide variety of uses, themes, etc. But what if you need something a little different? Well, it is very customizable and flexible with filter hooks that allow you to use a function to filter the form before it is displayed. Continue Reading →
Working with Templates: Block a Category Archive Loop Advanced
This post builds on the example we looked at in Working with Templates: Block a Category Archive Loop. That example describes how to replace the results of the loop with a message directing the user to login. Instead of replacing with a message, this example will show you how to replace with the WP-Members login form.
The tricky part in this example is that you can’t just put the login form in without modification. Unmodified, it will post to the URL of the first post in the loop of posts. So we’ll want to filter the form to replace that with the link to the category archive we are showing. Continue Reading →
Remove an unparsed wpmem_txt shortcode
The wpmem_txt shortcode is something that WP-Members puts in on the fly and its purpose is to prevent WordPress from putting line breaks (<p> and <br /> via the wpautop and wptexturize functions) into the form, thus throwing off the layout. This is one of those magic things that runs in the background that no one really knows about unless something breaks it.
Here is the problem: WordPress runs the shortcode parser on the content only once. By itself, that’s not a problem. However, if a plugin or theme developer includes a shortcode in their code and they do not use the function do_shortcode() on the $content variable before returning it, any shortcodes that are executed after theirs will be unparsed. For WP-Members, a bad practice like that will result in leaving wpmem_txt unparsed in your form.
So… how do you fix this? Continue Reading →
Add a helpful dialog above the password reset form
Suppose you want to add a little text above the password reset form that will help the user know what to do – in this case, put in your username and email and you’ll receive an email with a new password. Here is an easy way to do that with the wpmem_login_form filter. Continue Reading →