bp_get_the_profile_field_optional_label()

Return the ‘optional’ markup in extended profile field labels.

Description

Return

(string) HTML for the optional label.

Source

File: bp-xprofile/bp-xprofile-template.php

function bp_get_the_profile_field_optional_label() {
	$retval = '';

	if ( ! bp_get_the_profile_field_is_required() ) {

		// @note Removed (optional) text from here for the future reference.
		$translated_string = __( '(optional)', 'buddyboss' );

		$retval = ' <span class="bp-optional-field-label">';
		$retval .= apply_filters( 'bp_get_the_profile_field_optional_label', $translated_string, bp_get_the_profile_field_id() );
		$retval .= '</span>';

	}

	return $retval;
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.