Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/26/2024 05:44:26 AM (2 years ago)
Author:
imath
Message:

Groups component: improve PHP code standards using WPCS

See #7228 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-notifications.php

    r13503 r13808  
    11611161function groups_screen_notification_settings() {
    11621162
    1163         if ( !$group_invite = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_invite', true ) )
     1163        if ( ! $group_invite = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_invite', true ) ) {
    11641164                $group_invite  = 'yes';
    1165 
    1166         if ( !$group_update = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_group_updated', true ) )
     1165        }
     1166
     1167        if ( ! $group_update = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_group_updated', true ) ) {
    11671168                $group_update  = 'yes';
    1168 
    1169         if ( !$group_promo = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_admin_promotion', true ) )
     1169        }
     1170
     1171        if ( ! $group_promo = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_admin_promotion', true ) ) {
    11701172                $group_promo   = 'yes';
    1171 
    1172         if ( !$group_request = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_membership_request', true ) )
     1173        }
     1174
     1175        if ( ! $group_request = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_membership_request', true ) ) {
    11731176                $group_request = 'yes';
     1177        }
    11741178
    11751179        if ( ! $group_request_completed = bp_get_user_meta( bp_displayed_user_id(), 'notification_membership_request_completed', true ) ) {
    … …  
    11821186                        <tr>
    11831187                                <th class="icon"></th>
    1184                                 <th class="title"><?php _ex( 'Groups', 'Group settings on notification settings page', 'buddypress' ) ?></th>
    1185                                 <th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>
    1186                                 <th class="no"><?php _e( 'No', 'buddypress' )?></th>
     1188                                <th class="title"><?php echo esc_html_x( 'Groups', 'Group settings on notification settings page', 'buddypress' ) ?></th>
     1189                                <th class="yes"><?php esc_html_e( 'Yes', 'buddypress' ) ?></th>
     1190                                <th class="no"><?php esc_html_e( 'No', 'buddypress' )?></th>
    11871191                        </tr>
    11881192                </thead>
    … …  
    11911195                        <tr id="groups-notification-settings-invitation">
    11921196                                <td></td>
    1193                                 <td><?php _ex( 'A member invites you to join a group', 'group settings on notification settings page','buddypress' ) ?></td>
     1197                                <td><?php echo esc_html_x( 'A member invites you to join a group', 'group settings on notification settings page','buddypress' ) ?></td>
    11941198                                <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" id="notification-groups-invite-yes" value="yes" <?php checked( $group_invite, 'yes', true ) ?>/><label for="notification-groups-invite-yes" class="bp-screen-reader-text"><?php
    11951199                                        /* translators: accessibility text */
    1196                                         _e( 'Yes, send email', 'buddypress' );
     1200                                        esc_html_e( 'Yes, send email', 'buddypress' );
    11971201                                ?></label></td>
    11981202                                <td class="no"><input type="radio" name="notifications[notification_groups_invite]" id="notification-groups-invite-no" value="no" <?php checked( $group_invite, 'no', true ) ?>/><label for="notification-groups-invite-no" class="bp-screen-reader-text"><?php
    11991203                                        /* translators: accessibility text */
    1200                                         _e( 'No, do not send email', 'buddypress' );
     1204                                        esc_html_e( 'No, do not send email', 'buddypress' );
    12011205                                ?></label></td>
    12021206                        </tr>
    12031207                        <tr id="groups-notification-settings-info-updated">
    12041208                                <td></td>
    1205                                 <td><?php _ex( 'Group information is updated', 'group settings on notification settings page', 'buddypress' ) ?></td>
     1209                                <td><?php echo esc_html_x( 'Group information is updated', 'group settings on notification settings page', 'buddypress' ) ?></td>
    12061210                                <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" id="notification-groups-group-updated-yes" value="yes" <?php checked( $group_update, 'yes', true ) ?>/><label for="notification-groups-group-updated-yes" class="bp-screen-reader-text"><?php
    12071211                                        /* translators: accessibility text */
    1208                                         _e( 'Yes, send email', 'buddypress' );
     1212                                        esc_html_e( 'Yes, send email', 'buddypress' );
    12091213                                ?></label></td>
    12101214                                <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" id="notification-groups-group-updated-no" value="no" <?php checked( $group_update, 'no', true ) ?>/><label for="notification-groups-group-updated-no" class="bp-screen-reader-text"><?php
    12111215                                        /* translators: accessibility text */
    1212                                         _e( 'No, do not send email', 'buddypress' );
     1216                                        esc_html_e( 'No, do not send email', 'buddypress' );
    12131217                                ?></label></td>
    12141218                        </tr>
    12151219                        <tr id="groups-notification-settings-promoted">
    12161220                                <td></td>
    1217                                 <td><?php _ex( 'You are promoted to a group administrator or moderator', 'group settings on notification settings page', 'buddypress' ) ?></td>
     1221                                <td><?php echo esc_html_x( 'You are promoted to a group administrator or moderator', 'group settings on notification settings page', 'buddypress' ) ?></td>
    12181222                                <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" id="notification-groups-admin-promotion-yes" value="yes" <?php checked( $group_promo, 'yes', true ) ?>/><label for="notification-groups-admin-promotion-yes" class="bp-screen-reader-text"><?php
    12191223                                        /* translators: accessibility text */
    1220                                         _e( 'Yes, send email', 'buddypress' );
     1224                                        esc_html_e( 'Yes, send email', 'buddypress' );
    12211225                                ?></label></td>
    12221226                                <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" id="notification-groups-admin-promotion-no" value="no" <?php checked( $group_promo, 'no', true ) ?>/><label for="notification-groups-admin-promotion-no" class="bp-screen-reader-text"><?php
    12231227                                        /* translators: accessibility text */
    1224                                         _e( 'No, do not send email', 'buddypress' );
     1228                                        esc_html_e( 'No, do not send email', 'buddypress' );
    12251229                                ?></label></td>
    12261230                        </tr>
    12271231                        <tr id="groups-notification-settings-request">
    12281232                                <td></td>
    1229                                 <td><?php _ex( 'A member requests to join a private group for which you are an admin', 'group settings on notification settings page', 'buddypress' ) ?></td>
     1233                                <td><?php echo esc_html_x( 'A member requests to join a private group for which you are an admin', 'group settings on notification settings page', 'buddypress' ) ?></td>
    12301234                                <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" id="notification-groups-membership-request-yes" value="yes" <?php checked( $group_request, 'yes', true ) ?>/><label for="notification-groups-membership-request-yes" class="bp-screen-reader-text"><?php
    12311235                                        /* translators: accessibility text */
    1232                                         _e( 'Yes, send email', 'buddypress' );
     1236                                        esc_html_e( 'Yes, send email', 'buddypress' );
    12331237                                ?></label></td>
    12341238                                <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" id="notification-groups-membership-request-no" value="no" <?php checked( $group_request, 'no', true ) ?>/><label for="notification-groups-membership-request-no" class="bp-screen-reader-text"><?php
    12351239                                        /* translators: accessibility text */
    1236                                         _e( 'No, do not send email', 'buddypress' );
     1240                                        esc_html_e( 'No, do not send email', 'buddypress' );
    12371241                                ?></label></td>
    12381242                        </tr>
    12391243                        <tr id="groups-notification-settings-request-completed">
    12401244                                <td></td>
    1241                                 <td><?php _ex( 'Your request to join a group has been approved or denied', 'group settings on notification settings page', 'buddypress' ) ?></td>
     1245                                <td><?php echo esc_html_x( 'Your request to join a group has been approved or denied', 'group settings on notification settings page', 'buddypress' ) ?></td>
    12421246                                <td class="yes"><input type="radio" name="notifications[notification_membership_request_completed]" id="notification-groups-membership-request-completed-yes" value="yes" <?php checked( $group_request_completed, 'yes', true ) ?>/><label for="notification-groups-membership-request-completed-yes" class="bp-screen-reader-text"><?php
    12431247                                        /* translators: accessibility text */
    1244                                         _e( 'Yes, send email', 'buddypress' );
     1248                                        esc_html_e( 'Yes, send email', 'buddypress' );
    12451249                                ?></label></td>
    12461250                                <td class="no"><input type="radio" name="notifications[notification_membership_request_completed]" id="notification-groups-membership-request-completed-no" value="no" <?php checked( $group_request_completed, 'no', true ) ?>/><label for="notification-groups-membership-request-completed-no" class="bp-screen-reader-text"><?php
    12471251                                        /* translators: accessibility text */
    1248                                         _e( 'No, do not send email', 'buddypress' );
     1252                                        esc_html_e( 'No, do not send email', 'buddypress' );
    12491253                                ?></label></td>
    12501254                        </tr>
Note: See TracChangeset for help on using the changeset viewer.