Skip to:
Content

BuddyPress.org

Ticket #6608: 6608-01.patch

File 6608-01.patch, 1.2 KB (added by hnla, 9 years ago)

Update use of checked() function for invite name input control

  • src/bp-groups/bp-groups-template.php

     
    49534953                        $invites = groups_get_invites_for_group( $r['user_id'], $r['group_id'] );
    49544954
    49554955                        for ( $i = 0, $count = count( $friends ); $i < $count; ++$i ) {
    4956                                 $checked = in_array( (int) $friends[ $i ]['id'], (array) $invites );
    4957                                 $items[] = '<' . $r['separator'] . '><input' . checked( $checked ) . ' type="checkbox" name="friends[]" id="f-' . esc_attr( $friends[ $i ]['id'] ) . '" value="' . esc_attr( $friends[ $i ]['id'] ) . '" /> ' . esc_html( $friends[ $i ]['full_name'] ) . '</' . $r['separator'] . '>';
     4956
     4957                                $checked = ( in_array( (int) $friends[ $i ]['id'], (array) $invites ) )? $friends[ $i ]['id'] : '';
     4958
     4959                                $items[] = '<' . $r['separator'] . '><label for="f-' . esc_attr( $friends[ $i ]['id'] ) . '"><input ' . checked( $checked, esc_attr( $friends[ $i ]['id'] ), false ) . ' type="checkbox" name="friends[]" id="f-' . esc_attr( $friends[ $i ]['id'] ) . '" value="' . esc_attr( $friends[ $i ]['id'] ) . '" /> ' . esc_html( $friends[ $i ]['full_name'] ) . '</label></' . $r['separator'] . '>';
    49584960                        }
    49594961                }
    49604962