bp_get_the_profile_field_edit_value()

Returns the XProfile field edit value.


Return Return

(string)


Source Source

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

	function bp_get_the_profile_field_edit_value() {
		global $field;

		// Make sure field data object exists.
		if ( ! isset( $field->data ) ) {
			$field->data = new stdClass;
		}

		// Default to empty value.
		if ( ! isset( $field->data->value ) ) {
			$field->data->value = '';
		}

		// Was a new value posted? If so, use it instead.
		if ( isset( $_POST['field_' . $field->id] ) ) {

			// This is sanitized via the filter below (based on the field type).
			$field->data->value = $_POST['field_' . $field->id];
		}

		/**
		 * Filters the XProfile field edit value.
		 *
		 * @since 1.1.0
		 *
		 * @param string $field_value Current field edit value.
		 * @param string $type        Type for the profile field.
		 * @param int    $id          ID for the profile field.
		 */
		return apply_filters( 'bp_get_the_profile_field_edit_value', $field->data->value, $field->type, $field->id );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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