bp_register_type_meta( string $type_tax, string $meta_key, array $args )

Registers a meta key for BuddyPress types.

Parameters Parameters


(string) (Required) The BuddyPress type taxonomy.


(string) (Required) The meta key to register.


(array) (Required) Data used to describe the meta key when registered. See register_meta() for a list of supported arguments.

Top ↑

Return Return

(bool) True if the meta key was successfully registered, false if not.

Source Source

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

function bp_register_type_meta( $type_tax, $meta_key, array $args ) {
	$taxonomies = wp_list_pluck( bp_get_default_taxonomies(), 'component' );

	if ( ! isset( $taxonomies[ $type_tax ] ) ) {
		return false;

	// register_term_meta() was introduced in WP 4.9.8.
	if ( ! bp_is_running_wp( '4.9.8' ) ) {
		$args['object_subtype'] = $type_tax;

		return register_meta( 'term', $meta_key, $args );

	return register_term_meta( $type_tax, $meta_key, $args );

Top ↑

Changelog Changelog

Version Description
7.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.