Changeset 13498
- Timestamp:
- 06/07/2023 04:39:59 AM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-admin.php
r13491 r13498 100 100 // Delete field. 101 101 } elseif ( ( false !== $field_id ) && ( in_array( $mode, array( 'delete_field', 'do_delete_field' ), true ) ) ) { 102 xprofile_admin_delete_field( $field_id, 'field' ); 102 $delete_data = false; 103 if ( isset( $_GET['delete_data'] ) && $_GET['delete_data'] ) { 104 $delete_data = true; 105 } 106 107 xprofile_admin_delete_field( $field_id, 'field', $delete_data ); 103 108 104 109 // Delete option. … … 791 796 $field = xprofile_get_field( $field_id, null, false ); 792 797 793 $base_url = remove_query_arg( array( ' mode', 'field_id', 'bp_xprofile_delete_field' ), $_SERVER['REQUEST_URI'] ); ?>798 $base_url = remove_query_arg( array( 'page', 'mode', 'field_id', 'bp_xprofile_delete_field' ), $_SERVER['REQUEST_URI'] ); ?> 794 799 795 800 <div class="wrap"> … … 809 814 <?php 810 815 printf( 811 /* translators: %s is the field type name. */ 812 esc_html__( 'You are about to delete the following %s:', 'buddypress' ), 813 $field_type 816 /* translators: 1 is the field type name. 2 is the field name */ 817 esc_html__( 'You are about to delete the following %1$s: %2$s.', 'buddypress' ), 818 esc_html( $field_type ), 819 '<strong>' . esc_html( $field->name ) . '</strong>' 814 820 ); 815 821 ?> 816 822 </p> 817 823 818 <ul class="bp-xprofile-delete-group-list"> 819 <li><?php echo esc_html( $field->name ); ?></li> 820 </ul> 821 822 <p><strong><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ); ?></strong></p> 823 824 <a class="button-primary" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'mode' => 'do_delete_field', 'field_id' => $field_id ), $base_url ), 'bp_xprofile_delete_field-' . $field_id, 'bp_xprofile_delete_field' ) ); ?>"><?php esc_html_e( 'Delete Permanently', 'buddypress' ); ?></a> 825 <a class="button" href="<?php echo esc_attr( $base_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ); ?></a> 824 <form action="<?php echo esc_url( $base_url ); ?>" method="get"> 825 <label> 826 <input type="checkbox" name="delete_data" value="1" <?php checked( true ); ?>/> 827 <?php esc_html_e( 'Also remove the deleted field corresponding data.', 'buddypress' ); ?> 828 </label> 829 <p><strong><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ); ?></strong></p> 830 <p> 831 <input type="hidden" name="page" value="bp-profile-setup" /> 832 <input type="hidden" name="mode" value="do_delete_field" /> 833 <input type="hidden" name="field_id" value="<?php echo esc_attr( $field_id ); ?>" /> 834 <?php 835 wp_nonce_field( 'bp_xprofile_delete_field-' . $field_id, 'bp_xprofile_delete_field' ); 836 submit_button( __( 'Delete Permanently', 'buddypress' ), 'primary', '', false ); 837 ?> 838 <a class="button" href="<?php echo esc_attr( $base_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ); ?></a> 839 </p> 840 </form> 826 841 </div> 827 828 842 <?php 829 843 }
Note: See TracChangeset
for help on using the changeset viewer.