Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( ! is_user_logged_in() ) { // Display WordPress login form:
- $args = array(
- 'redirect' => admin_url(),
- 'form_id' => 'loginform-custom',
- 'label_username' => __( 'Username custom text' ),
- 'label_password' => __( 'Password custom text' ),
- 'label_remember' => __( 'Remember Me custom text' ),
- 'label_log_in' => __( 'Log In custom text' ),
- 'remember' => true
- );
- wp_login_form( $args );
- } else { // If logged in:
- wp_loginout( home_url() ); // Display "Log Out" link.
- echo " | ";
- wp_register('', ''); // Display "Site Admin" link.
- }
- ?>
- function wp_authenticate($username, $password) {
- $username = sanitize_user($username);
- $password = trim($password);
- $user = apply_filters('authenticate', null, $username, $password);
- if ( $user == null ) {
- $user = new WP_Error('authentication_failed', __('<strong>ERROR</strong>: Invalid username or incorrect password.'));
- }
- $ignore_codes = array('empty_username', 'empty_password');
- if (is_wp_error($user) && !in_array($user->get_error_code(), $ignore_codes) ) {
- // Put your code here
- }
- return $user;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement