bp_refresh_member_types_cache( int $post_id, post $post, bool $update )

Build the cache for the bp_active_member_types post types.

Description

Parameters

$post_id

(int) (Required) The post ID.

$post

(post) (Required) The post object.

$update

(bool) (Required) Whether this is an existing member type being updated or not.

Source

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

function bp_refresh_member_types_cache( $post_id, $post, $update ) {

	/*
	 * In production code, $slug should be set only once in the plugin,
	 * preferably as a class property, rather than in each function that needs it.
	 */
	$post_type = get_post_type($post_id);

	// If this isn't a 'member_type' post, don't update it.
	if ( bp_get_member_type_post_type() !== $post_type ) return;

	// Force the cache refresh for active_member_types posts.
	bp_get_active_member_types( $force_refresh = true );

}

Changelog

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