Skip to:
Content

BuddyPress.org

Ticket #8216: 8216.patch

File 8216.patch, 4.8 KB (added by passoniate, 6 years ago)

Patch

  • src/bp-xprofile/bp-xprofile-functions.php

     
    479479 *
    480480 * @param int    $field_id         The ID of the xprofile field.
    481481 * @param int    $user_id          The ID of the user to whom the data belongs.
    482  * @param string $visibility_level What the visibity setting should be.
     482 * @param string $visibility_level What the visibility setting should be.
    483483 * @return bool True on success
    484484 */
    485485function xprofile_set_field_visibility_level( $field_id = 0, $user_id = 0, $visibility_level = '' ) {
     
    13421342 *
    13431343 * @since 4.0.0
    13441344 *
    1345  * @param string $email_address  The userss email address.
     1345 * @param string $email_address  The users email address.
    13461346 * @return array An array of personal data.
    13471347 */
    13481348function bp_xprofile_personal_data_exporter( $email_address ) {
  • src/bp-xprofile/bp-xprofile-template.php

     
    593593        function bp_get_the_profile_field_edit_value() {
    594594                global $field;
    595595
    596                 // Make sure field data object exists
     596                // Make sure field data object exists.
    597597                if ( ! isset( $field->data ) ) {
    598598                        $field->data = new stdClass;
    599599                }
    600600
    601                 // Default to empty value
     601                // Default to empty value.
    602602                if ( ! isset( $field->data->value ) ) {
    603603                        $field->data->value = '';
    604604                }
     
    606606                // Was a new value posted? If so, use it instead.
    607607                if ( isset( $_POST['field_' . $field->id] ) ) {
    608608
    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).
    610610                        $field->data->value = $_POST['field_' . $field->id];
    611611                }
    612612
  • src/bp-xprofile/classes/class-bp-xprofile-field-type.php

     
    491491        /** Protected *************************************************************/
    492492
    493493        /**
    494          * Get a sanitised 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.
    495495         *
    496496         * Must be used inside the {@link bp_profile_fields()} template loop.
    497497         * 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

     
    177177                if ( ! empty( $id ) ) {
    178178                        $this->populate( $id, $user_id, $get_data );
    179179
    180                 // Initialise the type obj to prevent fatals when creating new profile fields.
     180                // Initialize the type obj to prevent fatals when creating new profile fields.
    181181                } else {
    182182                        $this->type_obj            = bp_xprofile_create_field_type( 'textbox' );
    183183                        $this->type_obj->field_obj = $this;
     
    639639                                }
    640640                        }
    641641
    642                         // If no member types have been saved, intepret as *all* member types.
     642                        // If no member types have been saved, interpret as *all* member types.
    643643                        if ( empty( $types ) ) {
    644644                                $types = array_values( $registered_types );
    645645
     
    10721072        }
    10731073
    10741074        /**
    1075          * Validate form field data on sumbission.
     1075         * Validate form field data on submission.
    10761076         *
    10771077         * @since 2.2.0
    10781078         *
     
    11071107                        return false;
    11081108                }
    11091109
    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.
    11111111                $field_type = bp_xprofile_create_field_type( $_POST['fieldtype'] );
    11121112
    11131113                // Field type requires options.
     
    11751175         */
    11761176        public function render_admin_form( $message = '' ) {
    11771177
    1178                 // Users Admin URL
     1178                // Users Admin URL.
    11791179                $users_url = bp_get_admin_url( 'users.php' );
    11801180
    1181                 // Add New
     1181                // Add New.
    11821182                if ( empty( $this->id ) ) {
    11831183                        $title  = __( 'Add New Field', 'buddypress' );
    11841184                        $button = __( 'Save',          'buddypress' );
     
    12001200                                }
    12011201                        }
    12021202
    1203                 // Edit
     1203                // Edit.
    12041204                } else {
    12051205                        $title  = __( 'Edit Field', 'buddypress' );
    12061206                        $button = __( 'Update',     'buddypress' );
     
    16131613         */
    16141614        private function default_field_hidden_inputs() {
    16151615
    1616                 // Nonce
     1616                // Nonce.
    16171617                wp_nonce_field( 'bp_xprofile_admin_field', 'bp_xprofile_admin_field' );
    16181618
    16191619                // Field 1 is the fullname field, which cannot have custom visibility.