Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/24/2021 04:16:17 AM (5 years ago)
Author:
espellcaste
Message:

Making PHPDoc Improvements to the BP Friends (component) files.

Also, adding several minor PHP changes.

See #8553

File:
1 edited

Legend:

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

    r12597 r13092  
    4444                        } else {
    4545                                /* translators: %s: friend name */
    46                                 $text = sprintf( __( '%s accepted your friendship request', 'buddypress' ),  bp_core_get_user_displayname( $item_id ) );
     46                                $text = sprintf( __( '%s accepted your friendship request', 'buddypress' ), bp_core_get_user_displayname( $item_id ) );
    4747                                $amount = 'single';
    4848                        }
    … …  
    6262                        } else {
    6363                                /* translators: %s: friend name */
    64                                 $text = sprintf( __( 'You have a friendship request from %s', 'buddypress' ),  bp_core_get_user_displayname( $item_id ) );
     64                                $text = sprintf( __( 'You have a friendship request from %s', 'buddypress' ), bp_core_get_user_displayname( $item_id ) );
    6565                                $amount = 'single';
    6666                        }
    … …  
    7070
    7171        // Return either an HTML link or an array, depending on the requested format.
    72         if ( 'string' == $format ) {
     72        if ( 'string' === $format ) {
    7373
    7474                /**
    … …  
    177177 * @since 1.9.0
    178178 *
    179  * @param int    $friendship_id Friendship ID (not used).
    180  * @param object $friendship    Friendship object.
     179 * @param int                   $friendship_id Friendship ID (not used).
     180 * @param BP_Friends_Friendship $friendship    The friendship object.
    181181 */
    182182function bp_friends_mark_friendship_rejected_notifications_by_item_id( $friendship_id, $friendship ) {
    … …  
    216216 * @since 1.9.0
    217217 *
    218  * @param int    $friendship_id Friendship ID (not used).
    219  * @param object $friendship    Friendship Object.
     218 * @param int                   $friendship_id Friendship ID (not used).
     219 * @param BP_Friends_Friendship $friendship    The friendship object.
    220220 */
    221221function bp_friends_mark_friendship_withdrawn_notifications_by_item_id( $friendship_id, $friendship ) {
    … …  
    243243function friends_screen_notification_settings() {
    244244
    245         if ( !$send_requests = bp_get_user_meta( bp_displayed_user_id(), 'notification_friends_friendship_request', true ) )
    246                 $send_requests   = 'yes';
    247 
    248         if ( !$accept_requests = bp_get_user_meta( bp_displayed_user_id(), 'notification_friends_friendship_accepted', true ) )
     245        if ( ! $send_requests = bp_get_user_meta( bp_displayed_user_id(), 'notification_friends_friendship_request', true ) ) {
     246                $send_requests = 'yes';
     247        }
     248
     249        if ( ! $accept_requests = bp_get_user_meta( bp_displayed_user_id(), 'notification_friends_friendship_accepted', true ) )
    249250                $accept_requests = 'yes'; ?>
    250251
    … …  
    253254                        <tr>
    254255                                <th class="icon"></th>
    255                                 <th class="title"><?php _ex( 'Friends', 'Friend settings on notification settings page', 'buddypress' ) ?></th>
    256                                 <th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>
    257                                 <th class="no"><?php _e( 'No', 'buddypress' )?></th>
     256                                <th class="title"><?php _ex( 'Friends', 'Friend settings on notification settings page', 'buddypress' ); ?></th>
     257                                <th class="yes"><?php esc_html_e( 'Yes', 'buddypress' ); ?></th>
     258                                <th class="no"><?php esc_html_e( 'No', 'buddypress' ); ?></th>
    258259                        </tr>
    259260                </thead>
    … …  
    262263                        <tr id="friends-notification-settings-request">
    263264                                <td></td>
    264                                 <td><?php _ex( 'A member sends you a friendship request', 'Friend settings on notification settings page', 'buddypress' ) ?></td>
     265                                <td><?php _ex( 'A member sends you a friendship request', 'Friend settings on notification settings page', 'buddypress' ); ?></td>
    265266                                <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" id="notification-friends-friendship-request-yes" value="yes" <?php checked( $send_requests, 'yes', true ) ?>/><label for="notification-friends-friendship-request-yes" class="bp-screen-reader-text"><?php
    266267                                        /* translators: accessibility text */
    267                                         _e( 'Yes, send email', 'buddypress' );
     268                                        esc_html_e( 'Yes, send email', 'buddypress' );
    268269                                ?></label></td>
    269270                                <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" id="notification-friends-friendship-request-no" value="no" <?php checked( $send_requests, 'no', true ) ?>/><label for="notification-friends-friendship-request-no" class="bp-screen-reader-text"><?php
    270271                                        /* translators: accessibility text */
    271                                         _e( 'No, do not send email', 'buddypress' );
     272                                        esc_html_e( 'No, do not send email', 'buddypress' );
    272273                                ?></label></td>
    273274                        </tr>
    … …  
    277278                                <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" id="notification-friends-friendship-accepted-yes" value="yes" <?php checked( $accept_requests, 'yes', true ) ?>/><label for="notification-friends-friendship-accepted-yes" class="bp-screen-reader-text"><?php
    278279                                        /* translators: accessibility text */
    279                                         _e( 'Yes, send email', 'buddypress' );
     280                                        esc_html_e( 'Yes, send email', 'buddypress' );
    280281                                ?></label></td>
    281282                                <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" id="notification-friends-friendship-accepted-no" value="no" <?php checked( $accept_requests, 'no', true ) ?>/><label for="notification-friends-friendship-accepted-no" class="bp-screen-reader-text"><?php
    282283                                        /* translators: accessibility text */
    283                                         _e( 'No, do not send email', 'buddypress' );
     284                                        esc_html_e( 'No, do not send email', 'buddypress' );
    284285                                ?></label></td>
    285286                        </tr>
Note: See TracChangeset for help on using the changeset viewer.