bp_get_group_member_demote_link( int $user_id, object|bool $group = false )

Generate a URL for demoting a user to member.

Description

Parameters

$user_id

(Required) ID of the member to demote. Default: current member in a member loop.

$group

(Optional) Group object. Default: current group.

Default value: false

Return

(string)

Source

File: bp-groups/bp-groups-template.php

	function bp_get_group_member_demote_link( $user_id = 0, $group = false ) {
		global $members_template, $groups_template;

		if ( empty( $group ) ) {
			$group =& $groups_template->group;
		}

		if ( !$user_id ) {
			$user_id = $members_template->member->user_id;
		}

		/**
		 * Filters a URL for demoting a user to member.
		 *
		 * @since BuddyPress 1.0.0
		 * @since BuddyPress 2.5.0 Added the `$group` parameter.
		 *
		 * @param string $value URL to use for demoting a user to member.
		 * @param object $group Group object.
		 */
		return apply_filters( 'bp_get_group_member_demote_link', wp_nonce_url( trailingslashit( bp_get_group_permalink( $group ) . 'admin/manage-members/demote/' . $user_id ), 'groups_demote_member' ), $group );
	}

Changelog

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