bp_blogs_get_blogmeta( int $blog_id, string $meta_key = '', bool $single = true )

Get metadata for a given blog.

Parameters Parameters


(int) (Required) ID of the blog whose metadata is being requested.


(string) (Optional) If present, only the metadata matching that meta key will be returned. Otherwise, all metadata for the blog will be fetched.

Default value: ''


(bool) (Optional) If true, return only the first value of the specified meta_key. This parameter has no effect if meta_key is not specified. Default: true.

Default value: true

Top ↑

Return Return

(mixed) The meta value(s) being requested.

Source Source

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

function bp_blogs_get_blogmeta( $blog_id, $meta_key = '', $single = true ) {
	add_filter( 'query', 'bp_filter_metaid_column_name' );
	add_filter( 'sanitize_key', 'bp_blogs_filter_meta_column_name' );
	$retval = get_metadata( 'bp_blog', $blog_id, $meta_key, $single );
	remove_filter( 'sanitize_key', 'bp_blogs_filter_meta_column_name' );
	remove_filter( 'query', 'bp_filter_metaid_column_name' );

	return $retval;

Top ↑

Changelog Changelog

Version Description
1.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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