diff --git src/bp-core/classes/class-bp-admin-types.php src/bp-core/classes/class-bp-admin-types.php
index 0ef4201ea..440f212f6 100644
|
|
|
class BP_Admin_Types {
|
| 316 | 316 | $taxonomy_object = get_taxonomy( $taxonomy ); |
| 317 | 317 | $labels = get_taxonomy_labels( $taxonomy_object ); |
| 318 | 318 | |
| | 319 | // Gets the Type's metadata. |
| | 320 | $metafields = get_registered_meta_keys( 'term', $taxonomy ); |
| | 321 | |
| | 322 | $this->display_meta_fields($metafields, $type, $labels, true); |
| | 323 | |
| 319 | 324 | // Default values for the Type ID field. |
| 320 | 325 | $type_id_label = __( 'Type ID', 'buddypress' ); |
| 321 | 326 | $type_id_desc = __( 'Enter a lower-case string without spaces or special characters (used internally to identify the type).', 'buddypress' ); |
| … |
… |
class BP_Admin_Types {
|
| 353 | 358 | ); |
| 354 | 359 | } |
| 355 | 360 | |
| 356 | | // Gets the Type's metadata. |
| 357 | | $metafields = get_registered_meta_keys( 'term', $taxonomy ); |
| | 361 | $this->display_meta_fields($metafields, $type, $labels, false); |
| | 362 | } |
| 358 | 363 | |
| | 364 | /** |
| | 365 | * Output the additional BP type's meta fields |
| | 366 | * |
| | 367 | * @param string[] $metafields List of registered meta keys. |
| | 368 | * @param null|object $type The type object, `null` if not passed to the method. |
| | 369 | * @param object $labels Taxonomy labels object |
| | 370 | * @param bool $is_name Is the meta field the singular/plurals name or another meta field ? |
| | 371 | */ |
| | 372 | private function display_meta_fields($metafields, $type, $labels, $is_name){ |
| 359 | 373 | foreach ( $metafields as $meta_key => $meta_schema ) { |
| 360 | 374 | if ( ! isset( $labels->{ $meta_key } ) || ! $labels->{ $meta_key } ) { |
| 361 | 375 | _doing_it_wrong( |
| … |
… |
class BP_Admin_Types {
|
| 371 | 385 | } |
| 372 | 386 | |
| 373 | 387 | $type_key = str_replace( 'bp_type_', '', $meta_key ); |
| | 388 | $is_name_meta_key = $is_name && ! in_array( $type_key, array( 'name', 'singular_name' ), true ); |
| | 389 | $is_not_name_meta_key = ! $is_name && in_array( $type_key, array( 'name', 'singular_name' ), true ) ; |
| | 390 | |
| | 391 | if( $is_name_meta_key || $is_not_name_meta_key ) { |
| | 392 | continue; |
| | 393 | } |
| 374 | 394 | |
| 375 | 395 | if ( 'string' === $meta_schema['type'] ) { |
| 376 | 396 | if ( isset( $type->name ) ) { |