Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/30/2020 09:26:01 AM (6 years ago)
Author:
imath
Message:

xProfile Group Admin: add confirmation screen for the delete action

Props oztaser

Fixes #8305

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-group.php

    r12534 r12660  
    832832                                'group_id' => (int) $this->id
    833833                        ), $users_url );
     834
     835                        if ( $this->can_delete ) {
     836                                // Delete Group URL.
     837                                $delete_url = wp_nonce_url( add_query_arg( array(
     838                                        'page'     => 'bp-profile-setup',
     839                                        'mode'     => 'delete_group',
     840                                        'group_id' => (int) $this->id
     841                                ), $users_url ), 'bp_xprofile_delete_group' );
     842                        }
    834843                } ?>
    835844
    … …  
    894903
    895904                                                        <div id="submitdiv" class="postbox">
    896                                                                 <h2><?php _e( 'Submit', 'buddypress' ); ?></h2>
     905                                                                <h2><?php esc_html_e( 'Submit', 'buddypress' ); ?></h2>
    897906                                                                <div class="inside">
    898907                                                                        <div id="submitcomment" class="submitbox">
    … …  
    918927                                                                                        </div>
    919928                                                                                        <div id="delete-action">
    920                                                                                                 <a href="<?php echo esc_url( $cancel_url ); ?>" class="deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a>
     929                                                                                                <?php if ( ! empty( $this->id ) && isset( $delete_url ) ) : ?>
     930                                                                                                        <a href="<?php echo esc_url( $delete_url ); ?>" class="submitdelete deletion"><?php esc_html_e( 'Delete Group', 'buddypress' ); ?></a>
     931                                                                                                <?php endif; ?>
     932
     933                                                                                                <div><a href="<?php echo esc_url( $cancel_url ); ?>" class="deletion"><?php esc_html_e( 'Cancel', 'buddypress' ); ?></a></div>
    921934                                                                                        </div>
    922935                                                                                        <div class="clear"></div>
Note: See TracChangeset for help on using the changeset viewer.