Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/29/2020 09:43:16 PM (6 years ago)
Author:
imath
Message:

Core: fix PHP code standards & typos in inline comments

Props passoniate

Fixes #8225
Fixes #8226
Fixes #8227
Fixes #8228
Fixes #8229

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/deprecated/1.9.php

    r11447 r12547  
    1010 */
    1111
    12 // Exit if accessed directly
     12// Exit if accessed directly.
    1313defined( 'ABSPATH' ) || exit;
    1414
     
    3131function bp_core_add_notification( $item_id, $user_id, $component_name, $component_action, $secondary_item_id = 0, $date_notified = false, $is_new = 1 ) {
    3232
    33         // Bail if notifications is not active
    34         if ( ! bp_is_active( 'notifications' ) ) {
    35                 return false;
    36         }
    37 
    38         // Trigger the deprecated function notice
     33        // Bail if notifications is not active.
     34        if ( ! bp_is_active( 'notifications' ) ) {
     35                return false;
     36        }
     37
     38        // Trigger the deprecated function notice.
    3939        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_add_notification()' );
    4040
    41         // Notifications must always have a time
     41        // Notifications must always have a time.
    4242        if ( false === $date_notified ) {
    4343                $date_notified = bp_core_current_time();
    4444        }
    4545
    46         // Add the notification
     46        // Add the notification.
    4747        return bp_notifications_add_notification( array(
    4848                'item_id'           => $item_id,
     
    6969function bp_core_delete_notification( $id ) {
    7070
    71         // Bail if notifications is not active
    72         if ( ! bp_is_active( 'notifications' ) ) {
    73                 return false;
    74         }
    75 
    76         // Trigger the deprecated function notice
     71        // Bail if notifications is not active.
     72        if ( ! bp_is_active( 'notifications' ) ) {
     73                return false;
     74        }
     75
     76        // Trigger the deprecated function notice.
    7777        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notification()' );
    7878
     
    9292function bp_core_get_notification( $id ) {
    9393
    94         // Bail if notifications is not active
    95         if ( ! bp_is_active( 'notifications' ) ) {
    96                 return false;
    97         }
    98 
    99         // Trigger the deprecated function notice
     94        // Bail if notifications is not active.
     95        if ( ! bp_is_active( 'notifications' ) ) {
     96                return false;
     97        }
     98
     99        // Trigger the deprecated function notice.
    100100        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_get_notification()' );
    101101
     
    116116function bp_core_get_notifications_for_user( $user_id, $format = 'string' ) {
    117117
    118         // Bail if notifications is not active
    119         if ( ! bp_is_active( 'notifications' ) ) {
    120                 return false;
    121         }
    122 
    123         // Trigger the deprecated function notice
     118        // Bail if notifications is not active.
     119        if ( ! bp_is_active( 'notifications' ) ) {
     120                return false;
     121        }
     122
     123        // Trigger the deprecated function notice.
    124124        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_get_notifications_for_user()' );
    125125
     
    146146function bp_core_delete_notifications_by_type( $user_id, $component_name, $component_action ) {
    147147
    148         // Bail if notifications is not active
    149         if ( ! bp_is_active( 'notifications' ) ) {
    150                 return false;
    151         }
    152 
    153         // Trigger the deprecated function notice
     148        // Bail if notifications is not active.
     149        if ( ! bp_is_active( 'notifications' ) ) {
     150                return false;
     151        }
     152
     153        // Trigger the deprecated function notice.
    154154        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notifications_by_type()' );
    155155
     
    175175function bp_core_delete_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
    176176
    177         // Bail if notifications is not active
    178         if ( ! bp_is_active( 'notifications' ) ) {
    179                 return false;
    180         }
    181 
    182         // Trigger the deprecated function notice
     177        // Bail if notifications is not active.
     178        if ( ! bp_is_active( 'notifications' ) ) {
     179                return false;
     180        }
     181
     182        // Trigger the deprecated function notice.
    183183        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notifications_by_item_id()' );
    184184
     
    201201function bp_core_delete_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false ) {
    202202
    203         // Bail if notifications is not active
    204         if ( ! bp_is_active( 'notifications' ) ) {
    205                 return false;
    206         }
    207 
    208         // Trigger the deprecated function notice
     203        // Bail if notifications is not active.
     204        if ( ! bp_is_active( 'notifications' ) ) {
     205                return false;
     206        }
     207
     208        // Trigger the deprecated function notice.
    209209        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_all_notifications_by_type()' );
    210210
     
    215215 * Delete all notifications for a user.
    216216 *
    217  * Used when clearing out all notifications for a user, when deleted or spammed
     217 * Used when clearing out all notifications for a user, when deleted or spammed.
    218218 *
    219219 * @deprecated Deprecated since BuddyPress 1.9.0. Use
     
    228228function bp_core_delete_notifications_from_user( $user_id, $component_name, $component_action ) {
    229229
    230         // Bail if notifications is not active
    231         if ( ! bp_is_active( 'notifications' ) ) {
    232                 return false;
    233         }
    234 
    235         // Trigger the deprecated function notice
     230        // Bail if notifications is not active.
     231        if ( ! bp_is_active( 'notifications' ) ) {
     232                return false;
     233        }
     234
     235        // Trigger the deprecated function notice.
    236236        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notifications_from_user()' );
    237237
     
    256256function bp_core_check_notification_access( $user_id, $notification_id ) {
    257257
    258         // Bail if notifications is not active
    259         if ( ! bp_is_active( 'notifications' ) ) {
    260                 return false;
    261         }
    262 
    263         // Trigger the deprecated function notice
     258        // Bail if notifications is not active.
     259        if ( ! bp_is_active( 'notifications' ) ) {
     260                return false;
     261        }
     262
     263        // Trigger the deprecated function notice.
    264264        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_check_notification_access()' );
    265265
Note: See TracChangeset for help on using the changeset viewer.