bp_core_no_access_wp_login_error( WP_Error $errors )
Add a custom BuddyPress no access error message to wp-login.php.
Description
Parameters
- $errors
-
(Required) Current error container.
Return
(WP_Error)
Source
File: bp-core/bp-core-catchuri.php
function bp_core_no_access_wp_login_error( $errors ) { if ( empty( $_GET['action'] ) || 'bpnoaccess' !== $_GET['action'] ) { return $errors; } /** * Filters the error message for wp-login.php when needing to log in before accessing. * * @since BuddyPress 1.5.0 * * @param string $value Error message to display. * @param string $value URL to redirect user to after successful login. */ $message = apply_filters( 'bp_wp_login_error', __( 'Please login to access this website.', 'buddyboss' ), $_REQUEST['redirect_to'] ); $errors->add( 'bp_no_access', $message ); return $errors; }
Changelog
Version | Description |
---|---|
BuddyPress 2.7.0 Hook moved to 'wp_login_errors' made available since WP 3.6.0. | BuddyPress 2.7.0 Hook moved to 'wp_login_errors' made available since WP 3.6.0. |
BuddyPress 1.5.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.