bp_get_group_type_metadata_schema( array $schema = array(), string $taxonomy = '' )

Extend generic Type metadata schema to match Group Type needs.


Parameters Parameters

$schema

(array) (Optional) The generic Type metadata schema.

Default value: array()

$taxonomy

(string) (Optional) The taxonomy name the schema applies to.

Default value: ''


Top ↑

Return Return

(array) The Group Type metadata schema.


Source Source

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

function bp_get_group_type_metadata_schema( $schema = array(), $taxonomy = '' ) {
	if ( bp_get_group_type_tax_name() === $taxonomy ) {

		// Directory
		if ( isset( $schema['bp_type_has_directory']['description'] ) ) {
			$schema['bp_type_has_directory']['description'] = __( 'Make a list of groups matching this type available on the groups directory.', 'buddypress' );
		}

		// Slug
		if ( isset( $schema['bp_type_directory_slug']['description'] ) ) {
			$schema['bp_type_directory_slug']['description'] = __( 'Enter if you want the type slug to be different from its ID.', 'buddypress' );
		}

		// Create
		$schema['bp_type_show_in_create_screen'] = array(
			'description'       => __( 'Show during group creation, and when a group admin is on the group’s settings page.', 'buddypress' ),
			'type'              => 'boolean',
			'single'            => true,
			'sanitize_callback' => 'absint',
		);

		// List
		$schema['bp_type_show_in_list'] = array(
			'description'       => __( 'Show where group types may be listed, like in the group header.', 'buddypress' ),
			'type'              => 'boolean',
			'single'            => true,
			'sanitize_callback' => 'absint',
		);
	}

	return $schema;
}


Top ↑

Changelog 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.