Often times, the WP-Members plugin may be used in a theme or other situation where there is already a log in link. A lot of these types of default log in links direct to the main WP login. But they often have the nice feature of redirecting back to the referring page. This example will show how to set up a WP-Members login page, create a link to this page, and include a redirect back to the referring page.
Continue Reading →Search Results for: short code
WP-Members 2.9.8 Release
Today we take one step closer to WP-Members 3.0! Version 2.9.8 includes some updates that lay the groundwork for moving the plugin into the next major version release.
Please be sure to read the release notes prior to updating to determine how you will be affected by these changes. It is always recommended that you test the update on a staging server prior to updating production.
This update does not make any changes to database settings during the update with the exception of the version number. If you need to roll back, the previous version (2.9.7) is available here. Continue Reading →
wpmem_inc_login_inputs
Description
DEPRECATED as of 3.3.0. Use wpmem_login_form_defaults instead.
This hook allows you to override the default inputs for the login form. The default consists of an array with two elements. Each element is an array of the form field input label (name), the field type (text|password), the tag for the input field, the CSS class for the input, and the class for the div wrapper.
New inputs can be added by adding to the array, or the existing inputs can be changed by changing the values in the array.
$default_inputs = array( array( 'name' => "Username or Email", // From $wpmem->get_text( 'login_username' ) 'type' => 'text', 'tag' => 'log', 'class' => 'username', 'div' => 'div_text', ), array( 'name' => "Password", // From $wpmem->get_text( 'login_password' ) 'type' => 'password', 'tag' => 'pwd', 'class' => 'password', 'div' => 'div_text', ), );
Parameters
$default_inputs
(array) (required) An array of elements that make up the login form field inputs.
Usage
The following example changes the label of the username field:
/** * Example changes username field label to * just "Email". * * Anything in the [0] array position is the * username field, the [1] position is the * password. */ add_filter( 'wpmem_inc_login_inputs', 'my_login_inputs' ); function my_login_inputs( $default_inputs ) { $default_inputs[0]['name'] = 'Email'; return $default_inputs; }
Changelog
Introduced in version 2.9.0
Source
wpmem_inc_login_inputs is located in /includes/class-wp-members-forms.php
Login form honey pot
We’ve discussed building a honey pot for the registration form to prevent spam signups by bots. But what about the login form? With WordPress being so much more ubiquitous across the Internet today, there are many more attempts to hack and exploit it. Many of these attempts are automated by bots.
Whether the login attempt comes from a bot or a human, the most common attempt for an exploit is to use the username “admin”. WordPress used to install the default admin account with the username “admin”. Fortunately, it no longer does this so you don’t have to delete the account to create a more secure admin account. But unfortunately, a great many people still create admin accounts with “admin” as the username.
An ounce of prevention is worth a pound of cure, so your best initial defense is to not have obvious usernames for administrative users. But a good second line of defense is to create a honey pot for the login form.
Continue Reading →Restrict Post or Page Access to Specific Users – Multiple Select Version
This is an extension of the ideas presented in the tutorial Restrict Post or Page Access to a Specific User with the twist that this version makes some minor changes to incorporate an HTML multi-select for selecting multiple users for access to a post.
Continue Reading →