Ticket #7536: 7536.1.patch
File 7536.1.patch, 7.0 KB (added by , 3 years ago) |
---|
-
bp-xprofile-admin.php
130 130 // Get all of the profile groups & fields. 131 131 $groups = bp_xprofile_get_groups( array( 132 132 'fetch_fields' => true 133 ) ); ?>133 ) ); 134 134 135 $users_url = bp_get_admin_url( 'users.php' ); ?> 136 135 137 <div class="wrap"> 136 138 137 139 <h1> 138 <?php _ex( 'Profile Fields', 'Settings page header', 'buddypress'); ?> 139 <a id="add_group" class="add-new-h2" href="users.php?page=bp-profile-setup&mode=add_group"><?php _e( 'Add New Field Group', 'buddypress' ); ?></a> 140 <?php 141 _ex( 'Profile Fields', 'Settings page header', 'buddypress' ); 142 $add_group_url = add_query_arg( array( 'page' => 'bp-profile-setup', 'mode' => 'add_group' ), $users_url ); 143 ?> 144 <a id="add_group" class="add-new-h2" href="<?php echo esc_url( $add_group_url ); ?>"><?php _e( 'Add New Field Group', 'buddypress' ); ?></a> 140 145 </h1> 141 146 142 147 <form action="" id="profile-field-form" method="post"> … … 190 195 <div id="tabs-<?php echo esc_attr( $group->id ); ?>" class="tab-wrapper"> 191 196 <div class="tab-toolbar"> 192 197 <div class="tab-toolbar-left"> 193 <a class="button-primary" href="users.php?page=bp-profile-setup&group_id=<?php echo esc_attr( $group->id ); ?>&mode=add_field"><?php _e( 'Add New Field', 'buddypress' ); ?></a> 194 <a class="button edit" href="users.php?page=bp-profile-setup&mode=edit_group&group_id=<?php echo esc_attr( $group->id ); ?>"><?php _ex( 'Edit Group', 'Edit Profile Fields Group', 'buddypress' ); ?></a> 198 <?php 199 $add_new_url = add_query_arg( array( 200 'page' => 'bp-profile-setup', 201 'mode' => 'add_field', 202 'group_id' => urlencode( $group->id ) 203 ), $users_url ); 204 $edit_url = add_query_arg( array( 205 'page' => 'bp-profile-setup', 206 'mode' => 'edit_group', 207 'group_id' => urlencode( $group->id ) 208 ), $users_url ); 209 $delete_url = add_query_arg( array( 210 'page' => 'bp-profile-setup', 211 'mode' => 'delete_group', 212 'group_id' => urlencode( $group->id ), 213 ), $users_url ); 214 ?> 215 <a class="button-primary" href="<?php echo esc_url( $add_new_url ); ?>"><?php _e( 'Add New Field', 'buddypress' ); ?></a> 216 <a class="button edit" href="<?php echo esc_url( $edit_url ); ?>"><?php _ex( 'Edit Group', 'Edit Profile Fields Group', 'buddypress' ); ?></a> 195 217 196 218 <?php if ( $group->can_delete ) : ?> 197 219 198 220 <div class="delete-button"> 199 <a class="confirm submitdelete deletion ajax-option-delete" href=" users.php?page=bp-profile-setup&mode=delete_group&group_id=<?php echo esc_attr( $group->id); ?>"><?php _ex( 'Delete Group', 'Delete Profile Fields Group', 'buddypress' ); ?></a>221 <a class="confirm submitdelete deletion ajax-option-delete" href="<?php echo esc_url( $delete_url ); ?>"><?php _ex( 'Delete Group', 'Delete Profile Fields Group', 'buddypress' ); ?></a> 200 222 </div> 201 223 202 224 <?php endif; ?> … … 272 294 <?php endforeach; else : ?> 273 295 274 296 <div id="message" class="error"><p><?php _ex( 'You have no groups.', 'You have no profile fields groups.', 'buddypress' ); ?></p></div> 275 <p><a href=" users.php?page=bp-profile-setup&mode=add_group"><?php _ex( 'Add New Group', 'Add New Profile Fields Group', 'buddypress' ); ?></a></p>297 <p><a href="<?php echo esc_url( $add_group_url ); ?>"><?php _ex( 'Add New Group', 'Add New Profile Fields Group', 'buddypress' ); ?></a></p> 276 298 277 299 <?php endif; ?> 278 300 -
classes/class-bp-xprofile-field.php
1147 1147 public function render_admin_form( $message = '' ) { 1148 1148 if ( empty( $this->id ) ) { 1149 1149 $title = __( 'Add New Field', 'buddypress' ); 1150 $action = "users.php?page=bp-profile-setup&group_id=" . $this->group_id . "&mode=add_field#tabs-" . $this->group_id; 1150 $action = add_query_arg( array( 1151 'page' => 'bp-profile-setup', 1152 'group_id' => urlencode( $this->group_id ), 1153 'mode' => 'add_field', 1154 ), bp_get_admin_url( 'users.php' ) . '#tabs-' . $this->group_id ); 1151 1155 $button = __( 'Save', 'buddypress' ); 1152 1156 1153 1157 if ( !empty( $_POST['saveField'] ) ) { … … 1163 1167 } 1164 1168 } else { 1165 1169 $title = __( 'Edit Field', 'buddypress' ); 1166 $action = "users.php?page=bp-profile-setup&mode=edit_field&group_id=" . $this->group_id . "&field_id=" . $this->id . "#tabs-" . $this->group_id; 1170 $action = add_query_arg( array( 1171 'page' => 'bp-profile-setup', 1172 'group_id' => urlencode( $this->group_id ), 1173 'field_id' => urlencode( $this->id ), 1174 'mode' => 'edit_field', 1175 ), bp_get_admin_url( 'users.php' ) . '#tabs-' . $this->group_id ); 1167 1176 $button = __( 'Update', 'buddypress' ); 1168 1177 } ?> 1169 1178 … … 1305 1314 <?php endif; ?> 1306 1315 1307 1316 <div id="delete-action"> 1308 <a href=" users.php?page=bp-profile-setup" class="deletion"><?php esc_html_e( 'Cancel', 'buddypress' ); ?></a>1317 <a href="<?php echo esc_url( add_query_arg( 'page', 'bp-profile-setup', bp_get_admin_url( 'users.php' ) ) ); ?>" class="deletion"><?php esc_html_e( 'Cancel', 'buddypress' ); ?></a> 1309 1318 </div> 1310 1319 1311 1320 <?php wp_nonce_field( 'xprofile_delete_option' ); ?> -
classes/class-bp-xprofile-group.php
719 719 // New field group. 720 720 if ( empty( $this->id ) ) { 721 721 $title = __( 'Add New Field Group', 'buddypress' ); 722 $action = add_query_arg( array( 'page' => 'bp-profile-setup', 'mode' => 'add_group' ), 'users.php');722 $action = add_query_arg( array( 'page' => 'bp-profile-setup', 'mode' => 'add_group' ), bp_get_admin_url( 'users.php' ) ); 723 723 $button = __( 'Save', 'buddypress' ); 724 724 725 725 // Existing field group. 726 726 } else { 727 727 $title = __( 'Edit Field Group', 'buddypress' ); 728 $action = add_query_arg( array( 'page' => 'bp-profile-setup', 'mode' => 'edit_group', 'group_id' => $this->id ), 'users.php');728 $action = add_query_arg( array( 'page' => 'bp-profile-setup', 'mode' => 'edit_group', 'group_id' => $this->id ), bp_get_admin_url( 'users.php' ) ); 729 729 $button = __( 'Update', 'buddypress' ); 730 730 } ?> 731 731 … … 813 813 <input type="submit" name="save_group" value="<?php echo esc_attr( $button ); ?>" class="button-primary"/> 814 814 </div> 815 815 <div id="delete-action"> 816 <a href=" users.php?page=bp-profile-setup" class="deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a>816 <a href="<?php echo esc_url( add_query_arg( 'page', 'bp-profile-setup', bp_get_admin_url( 'users.php' ) ) ); ?>" class="deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a> 817 817 </div> 818 818 <div class="clear"></div> 819 819 </div>