Ticket #8216: 8216.patch
| File 8216.patch, 4.8 KB (added by , 6 years ago) |
|---|
-
src/bp-xprofile/bp-xprofile-functions.php
479 479 * 480 480 * @param int $field_id The ID of the xprofile field. 481 481 * @param int $user_id The ID of the user to whom the data belongs. 482 * @param string $visibility_level What the visibi ty setting should be.482 * @param string $visibility_level What the visibility setting should be. 483 483 * @return bool True on success 484 484 */ 485 485 function xprofile_set_field_visibility_level( $field_id = 0, $user_id = 0, $visibility_level = '' ) { … … 1342 1342 * 1343 1343 * @since 4.0.0 1344 1344 * 1345 * @param string $email_address The users semail address.1345 * @param string $email_address The users email address. 1346 1346 * @return array An array of personal data. 1347 1347 */ 1348 1348 function bp_xprofile_personal_data_exporter( $email_address ) { -
src/bp-xprofile/bp-xprofile-template.php
593 593 function bp_get_the_profile_field_edit_value() { 594 594 global $field; 595 595 596 // Make sure field data object exists 596 // Make sure field data object exists. 597 597 if ( ! isset( $field->data ) ) { 598 598 $field->data = new stdClass; 599 599 } 600 600 601 // Default to empty value 601 // Default to empty value. 602 602 if ( ! isset( $field->data->value ) ) { 603 603 $field->data->value = ''; 604 604 } … … 606 606 // Was a new value posted? If so, use it instead. 607 607 if ( isset( $_POST['field_' . $field->id] ) ) { 608 608 609 // This is sanitized via the filter below (based on the field type) 609 // This is sanitized via the filter below (based on the field type). 610 610 $field->data->value = $_POST['field_' . $field->id]; 611 611 } 612 612 -
src/bp-xprofile/classes/class-bp-xprofile-field-type.php
491 491 /** Protected *************************************************************/ 492 492 493 493 /** 494 * Get a saniti sed and escaped string of the edit field's HTML elements and attributes.494 * Get a sanitized and escaped string of the edit field's HTML elements and attributes. 495 495 * 496 496 * Must be used inside the {@link bp_profile_fields()} template loop. 497 497 * This method was intended to be static but couldn't be because php.net/lsb/ requires PHP >= 5.3. -
src/bp-xprofile/classes/class-bp-xprofile-field.php
177 177 if ( ! empty( $id ) ) { 178 178 $this->populate( $id, $user_id, $get_data ); 179 179 180 // Initiali se the type obj to prevent fatals when creating new profile fields.180 // Initialize the type obj to prevent fatals when creating new profile fields. 181 181 } else { 182 182 $this->type_obj = bp_xprofile_create_field_type( 'textbox' ); 183 183 $this->type_obj->field_obj = $this; … … 639 639 } 640 640 } 641 641 642 // If no member types have been saved, inte pret as *all* member types.642 // If no member types have been saved, interpret as *all* member types. 643 643 if ( empty( $types ) ) { 644 644 $types = array_values( $registered_types ); 645 645 … … 1072 1072 } 1073 1073 1074 1074 /** 1075 * Validate form field data on su mbission.1075 * Validate form field data on submission. 1076 1076 * 1077 1077 * @since 2.2.0 1078 1078 * … … 1107 1107 return false; 1108 1108 } 1109 1109 1110 // Get field type so we can check for and lavidate any field options.1110 // Get field type so we can check for and validate any field options. 1111 1111 $field_type = bp_xprofile_create_field_type( $_POST['fieldtype'] ); 1112 1112 1113 1113 // Field type requires options. … … 1175 1175 */ 1176 1176 public function render_admin_form( $message = '' ) { 1177 1177 1178 // Users Admin URL 1178 // Users Admin URL. 1179 1179 $users_url = bp_get_admin_url( 'users.php' ); 1180 1180 1181 // Add New 1181 // Add New. 1182 1182 if ( empty( $this->id ) ) { 1183 1183 $title = __( 'Add New Field', 'buddypress' ); 1184 1184 $button = __( 'Save', 'buddypress' ); … … 1200 1200 } 1201 1201 } 1202 1202 1203 // Edit 1203 // Edit. 1204 1204 } else { 1205 1205 $title = __( 'Edit Field', 'buddypress' ); 1206 1206 $button = __( 'Update', 'buddypress' ); … … 1613 1613 */ 1614 1614 private function default_field_hidden_inputs() { 1615 1615 1616 // Nonce 1616 // Nonce. 1617 1617 wp_nonce_field( 'bp_xprofile_admin_field', 'bp_xprofile_admin_field' ); 1618 1618 1619 1619 // Field 1 is the fullname field, which cannot have custom visibility.