Changeset 12529
- Timestamp:
- 01/18/2020 12:44:17 PM (5 years ago)
- Location:
- trunk/src/bp-xprofile
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-admin.php
r11808 r12529 46 46 : false; 47 47 48 // Group ID 48 // Group ID. 49 49 $group_id = ! empty( $_GET['group_id'] ) 50 50 ? intval( $_GET['group_id'] ) 51 51 : false; 52 52 53 // Field ID 53 // Field ID. 54 54 $field_id = ! empty( $_GET['field_id'] ) 55 55 ? intval( $_GET['field_id'] ) 56 56 : false; 57 57 58 // Option ID 58 // Option ID. 59 59 $option_id = ! empty( $_GET['option_id'] ) 60 60 ? intval( $_GET['option_id'] ) 61 61 : false; 62 62 63 // Allowed modes 63 // Allowed modes. 64 64 $allowed_modes = array( 65 65 'add_group', … … 72 72 ); 73 73 74 // Is an allowed mode 74 // Is an allowed mode. 75 75 if ( in_array( $mode, $allowed_modes, true ) ) { 76 76 77 // All group actions 77 // All group actions. 78 78 if ( false !== $group_id ) { 79 79 80 // Add field to group 80 // Add field to group. 81 81 if ( 'add_field' == $mode ) { 82 82 xprofile_admin_manage_field( $group_id ); 83 83 84 // Edit field of group 84 // Edit field of group. 85 85 } elseif ( ! empty( $field_id ) && 'edit_field' === $mode ) { 86 86 xprofile_admin_manage_field( $group_id, $field_id ); 87 87 88 // Delete group 88 // Delete group. 89 89 } elseif ( 'delete_group' === $mode ) { 90 90 xprofile_admin_delete_group( $group_id ); 91 91 92 // Edit group 92 // Edit group. 93 93 } elseif ( 'edit_group' === $mode ) { 94 94 xprofile_admin_manage_group( $group_id ); 95 95 } 96 96 97 // Delete field 97 // Delete field. 98 98 } elseif ( ( false !== $field_id ) && ( 'delete_field' === $mode ) ) { 99 99 xprofile_admin_delete_field( $field_id, 'field'); 100 100 101 // Delete option 101 // Delete option. 102 102 } elseif ( ! empty( $option_id ) && 'delete_option' === $mode ) { 103 103 xprofile_admin_delete_field( $option_id, 'option' ); 104 104 105 // Add group 105 // Add group. 106 106 } elseif ( 'add_group' == $mode ) { 107 107 xprofile_admin_manage_group(); … … 125 125 function xprofile_admin_screen( $message = '', $type = 'error' ) { 126 126 127 // Users admin URL 127 // Users admin URL. 128 128 $url = bp_get_admin_url( 'users.php' ); 129 129 130 // Add Group 130 // Add Group. 131 131 $add_group_url = add_query_arg( array( 132 132 'page' => 'bp-profile-setup', … … 201 201 <?php if ( !empty( $groups ) ) : foreach ( $groups as $group ) : 202 202 203 // Add Field to Group URL 203 // Add Field to Group URL. 204 204 $add_field_url = add_query_arg( array( 205 205 'page' => 'bp-profile-setup', … … 208 208 ), $url ); 209 209 210 // Edit Group URL 210 // Edit Group URL. 211 211 $edit_group_url = add_query_arg( array( 212 212 'page' => 'bp-profile-setup', … … 215 215 ), $url ); 216 216 217 // Delete Group URL 217 // Delete Group URL. 218 218 $delete_group_url = wp_nonce_url( add_query_arg( array( 219 219 'page' => 'bp-profile-setup', … … 341 341 if ( isset( $_POST['save_group'] ) ) { 342 342 343 // Check nonce 343 // Check nonce. 344 344 check_admin_referer( 'bp_xprofile_admin_group', 'bp_xprofile_admin_group' ); 345 345 … … 367 367 $type = 'success'; 368 368 369 // @todo remove these old options 369 // @todo remove these old options. 370 370 if ( 1 == $group_id ) { 371 371 bp_update_option( 'bp-xprofile-base-group-name', $group->name ); … … 449 449 if ( isset( $_POST['saveField'] ) ) { 450 450 451 // Check nonce 451 // Check nonce. 452 452 check_admin_referer( 'bp_xprofile_admin_field', 'bp_xprofile_admin_field' ); 453 453 … … 484 484 $type = 'success'; 485 485 486 // @todo remove these old options 486 // @todo remove these old options. 487 487 if ( 1 == $field_id ) { 488 488 bp_update_option( 'bp-xprofile-fullname-field-name', $field->name ); … … 650 650 $field = $admin_field; 651 651 652 // Users admin URL 652 // Users admin URL. 653 653 $url = bp_get_admin_url( 'users.php' ); 654 654 655 // Edit 655 // Edit. 656 656 $field_edit_url = add_query_arg( array( 657 657 'page' => 'bp-profile-setup', … … 661 661 ), $url ); 662 662 663 // Delete 663 // Delete. 664 664 if ( $field->can_delete ) { 665 665 $field_delete_url = add_query_arg( array( -
trunk/src/bp-xprofile/bp-xprofile-cache.php
r12317 r12529 181 181 * @since 2.1.0 182 182 * 183 * @param object $group_obj Grou bobject to clear.183 * @param object $group_obj Group object to clear. 184 184 */ 185 185 function xprofile_clear_profile_groups_object_cache( $group_obj ) { -
trunk/src/bp-xprofile/bp-xprofile-filters.php
r12416 r12529 194 194 * @since 1.2.6 195 195 * 196 * @param string $field_value Field value being san tized.196 * @param string $field_value Field value being sanitized. 197 197 * @param int $field_id Field ID being sanitized. 198 198 * @param bool $reserialize Whether to reserialize arrays before returning. Defaults to true. … … 409 409 * Before splitting on the ";" character, decode the HTML entities, and re-encode after. 410 410 * This prevents input like "O'Hara" rendering as "O' Hara" (with each of those parts 411 * having a sep erate HTML link).411 * having a separate HTML link). 412 412 */ 413 413 $list_type = 'semicolon'; -
trunk/src/bp-xprofile/bp-xprofile-functions.php
r12110 r12529 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 */ … … 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 */ -
trunk/src/bp-xprofile/bp-xprofile-template.php
r12515 r12529 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 = ''; … … 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 } -
trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type.php
r11834 r12529 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. -
trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php
r12317 r12529 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' ); … … 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 ); … … 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 … … 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 … … 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' ); … … 1201 1201 } 1202 1202 1203 // Edit 1203 // Edit. 1204 1204 } else { 1205 1205 $title = __( 'Edit Field', 'buddypress' ); … … 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
Note: See TracChangeset
for help on using the changeset viewer.