BP_Admin_Types::edit_form_fields( WP_Term $term = null, string $taxonomy = '' )

Outputs the BP type edit form.


Parameters Parameters

$term

(WP_Term) (Optional) The term object for the BP Type.

Default value: null

$taxonomy

(string) (Optional) The type taxonomy name.

Default value: ''


Top ↑

Return Return

(string) HTML Output.


Source Source

File: bp-core/classes/class-bp-admin-types.php

	public function edit_form_fields( $term = null, $taxonomy = '' ) {
		if ( ! isset( $term->name ) || ! $term->name || ! $taxonomy ) {
			return;
		}

		$type         = new stdClass();
		$type->name   = $term->name;
		$type->labels = array();
		$metadatas    = get_metadata( 'term', $term->term_id );

		foreach ( $metadatas as $meta_key => $meta_values ) {
			$meta_value = reset( $meta_values );
			$type_key   = str_replace( 'bp_type_', '', $meta_key );

			if ( in_array( $type_key, array( 'name', 'singular_name' ), true ) ) {
				$type->labels[ $type_key ] = $meta_value;
			} else {
				$type->{$type_key} = $meta_value;
			}
		}

		return $this->add_form_fields( $taxonomy, $type );
	}


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.