bp_get_admin_url( string $path = '', string $scheme = 'admin' )

Return the correct admin URL based on BuddyPress and WordPress configuration.

Description

Parameters

$path

(Optional) The sub-path under /wp-admin to be appended to the admin URL.

Default value: ''

$scheme

(Optional) The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.

Default value: 'admin'

Return

(string) Admin url link with optional path appended.

Source

File: bp-core/bp-core-functions.php

	function bp_get_admin_url( $path = '', $scheme = 'admin' ) {

		// Links belong in network admin.
		if ( bp_core_do_network_admin() ) {
			$url = network_admin_url( $path, $scheme );

		// Links belong in site admin.
		} else {
			$url = admin_url( $path, $scheme );
		}

		return $url;
	}

Changelog

Changelog
Version Description
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.