bp_core_no_access_wp_login_error

Add a custom BuddyPress no access error message to wp-login.php.

Description

(WP_Error) bp_core_no_access_wp_login_error( (WP_Error) $errors ); 

Returns (WP_Error)

Parameters (1)

0. $errors (WP_Error)
Current error container.

Usage

  1. if ( !function_exists( 'bp_core_no_access_wp_login_error' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-catchuri.php'; 
  3.  
  4. // Current error container. 
  5. $errors = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_core_no_access_wp_login_error($errors); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-core/bp-core-catchuri.php  
  1. function bp_core_no_access_wp_login_error( $errors ) { 
  2. if ( empty( $_GET['action'] ) || 'bpnoaccess' !== $_GET['action'] ) { 
  3. return $errors; 
  4.  
  5. /** 
  6. * Filters theerrormessage for wp-login.php when needing to log in before accessing. 
  7. * @since 1.5.0 
  8. * @param string $value Error message to display. 
  9. * @param string $value URL to redirect user to after successful login. 
  10. */ 
  11. $message = apply_filters( 'bp_wp_login_error', __( 'You must log in to access the page you requested.', buddypress ), $_REQUEST['redirect_to'] ); 
  12.  
  13. $errors->add( 'bp_no_access', $message ); 
  14.  
  15. return $errors;