bp_register_active_member_types()

Register all active profile types.

Description

Source

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

function bp_register_active_member_types() {


	$post_ids = bp_get_active_member_types();

	//update meta cache to avoid multiple db calls
	update_meta_cache( 'post', $post_ids );
	//build to register the memebr type
	$member_types = array();

	foreach ( $post_ids as $post_id ) {

		$key = bp_get_member_type_key( $post_id );

		$enable_filter = get_post_meta( $post_id, '_bp_member_type_enable_filter', true );

		$has_dir = false;

		if ( $enable_filter ) {
			$has_dir = true;
		}

		$member_types[ $key ] = array(
			'labels' => array(
				'name' => get_post_meta( $post_id, '_bp_member_type_label_name', true ),
				'singular_name' => get_post_meta( $post_id, '_bp_member_type_label_singular_name', true ),
			),
			'has_directory' => $has_dir
		);
	}

	foreach ( $member_types as $member_type => $args ) {
		bp_register_member_type( $member_type, $args );
	}
}

Changelog

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