Skip to:
Content

BuddyPress.org

Changeset 12902


Ignore:
Timestamp:
04/21/2021 02:53:57 PM (5 months ago)
Author:
dcavins
Message:

BP Tools: Use radio buttons to choose operation.

Use a radio button group instead of checkboxes to
select which one operation to run from the WP Admin
BP Tools screen.

Fixes #8458.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/admin/bp-core-admin-tools.php

    r12899 r12902  
    2929        <p><?php esc_html_e( 'Use the tools below to manually recalculate these relationships.', 'buddypress' ); ?>
    3030        </p>
    31         <p class="attention"><?php esc_html_e( 'Some of these tools create substantial database overhead. Avoid running more than one repair job at a time.', 'buddypress' ); ?></p>
    32 
    33         <h2><?php esc_html_e( 'Activate checkboxe(s) to select the operation(s) to perform', 'buddypress' ); ?></h2>
     31
     32        <h2><?php esc_html_e( 'Select the operation to perform', 'buddypress' ); ?></h2>
    3433
    3534        <form class="settings" method="post" action="">
     
    4140                    <p>
    4241                        <label for="<?php echo esc_attr( str_replace( '_', '-', $item[0] ) ); ?>">
    43                             <input type="checkbox" class="checkbox" name="<?php echo esc_attr( $item[0] ) . '" id="' . esc_attr( str_replace( '_', '-', $item[0] ) ); ?>" value="1" /> <?php echo esc_html( $item[1] ); ?>
     42                            <input type="radio" class="radio" name="bp-tools-run[]" id="<?php echo esc_attr( str_replace( '_', '-', $item[0] ) ); ?>" value="<?php echo esc_attr( $item[0] ); ?>" /> <?php echo esc_html( $item[1] ); ?>
    4443                        </label>
    4544                    </p>
     
    8281
    8382    foreach ( (array) bp_admin_repair_list() as $item ) {
    84         if ( isset( $item[2] ) && isset( $_POST[$item[0]] ) && 1 === absint( $_POST[$item[0]] ) && is_callable( $item[2] ) ) {
     83        if ( isset( $item[2] ) && isset( $_POST['bp-tools-run'] ) && in_array( $item[0], (array) $_POST['bp-tools-run'], true ) && is_callable( $item[2] ) ) {
    8584            $messages[] = call_user_func( $item[2] );
    8685        }
Note: See TracChangeset for help on using the changeset viewer.