Toggle Side Panel
BuddyBoss Resources
  • Knowledge Base
    • All Articles
    • BuddyBoss Platform
    • BuddyBoss Theme
    • BuddyBoss App
    • Integrations
    • Advanced Setup
    • Troubleshooting
    • Release Notes
      • BuddyBoss Platform
      • BuddyBoss Platform Pro
      • BuddyBoss Theme
      • BuddyBoss App
      • BuddyBoss App Plugin
      • Other Products
  • Developers
    • Developer Tutorials
      • Web Development
      • App Development
    • Code Reference
      • Functions
      • Hooks
      • Classes
      • Methods
      • Commands
      • App Codex
    • REST API
      • BuddyBoss Platform
      • BuddyBoss App
    • Font Cheatsheet
    • Github Project
  • Roadmap
  • Go to BuddyBoss
More options
    Contact Support
    Filter
    • Knowledge Base
      • All Articles
      • BuddyBoss Platform
      • BuddyBoss Theme
      • BuddyBoss App
      • Integrations
      • Advanced Setup
      • Troubleshooting
      • Release Notes
        • BuddyBoss Platform
        • BuddyBoss Platform Pro
        • BuddyBoss Theme
        • BuddyBoss App
        • BuddyBoss App Plugin
        • Other Products
    • Developers
      • Developer Tutorials
        • Web Development
        • App Development
      • Code Reference
        • Functions
        • Hooks
        • Classes
        • Methods
        • Commands
        • App Codex
      • REST API
        • BuddyBoss Platform
        • BuddyBoss App
      • Font Cheatsheet
      • Github Project
    • Roadmap
    • Go to BuddyBoss
    Filter
    Close search
    Filter

    Contents

    • Description
    • Parameters
    • Return
    • Source
    • Changelog
    • Related
    Code Reference Functions bp_core_no_access_wp_login_error()

    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;
    }
    

    Expand full source code Collapse full source code

    Changelog

    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.

    Related

    Uses

    Uses
    Uses Description
    bp-core/bp-core-catchuri.php: bp_wp_login_error

    Filters the error message for wp-login.php when needing to log in before accessing.

    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.

    © 2025 • BuddyBoss