bp_block_category( array $categories = array(),  $editor_name_or_post = null )

Adds a BuddyPress category to house BuddyPress blocks.


Parameters Parameters

$categories

(array) (Optional) Array of block categories.

Default value: array()

$post

(string|WP_Post) (Required) Post being loaded.


Source Source

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

function bp_block_category( $categories = array(), $editor_name_or_post = null ) {
	if ( $editor_name_or_post instanceof WP_Post ) {
		$post_types = array( 'post', 'page' );

		/*
		 * As blocks are always loaded even if the category is not available, there's no more interest
		 * in disabling the BuddyPress category.
		 */
		apply_filters_deprecated( 'bp_block_category_post_types', array( $post_types ), '8.0.0' );
	}

	return array_merge(
		$categories,
		array(
			array(
				'slug'  => 'buddypress',
				'title' => __( 'BuddyPress', 'buddypress' ),
				'icon'  => 'buddicons-buddypress-logo',
			),
		)
	);
}

Top ↑

Changelog Changelog

Changelog
Version Description
8.0.0 The bp_block_category_post_types filter has been deprecated.
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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