Skip to:
Content

BuddyPress.org

Ticket #8228: 8228.patch

File 8228.patch, 9.9 KB (added by passoniate, 4 years ago)

Patch

  • src/bp-core/deprecated/1.5.php

     
    77 * @deprecated Since 1.5.0
    88 */
    99
    10 // Exit if accessed directly
     10// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    1212
    1313/** Loader ********************************************************************/
     
    7474
    7575/**
    7676 * In BuddyPress 1.1 - 1.2.x, this function provided a better version of add_menu_page()
    77  * that allowed positioning of menus. Deprecated in 1.5 in favour of a WP core function.
     77 * that allowed positioning of menus. Deprecated in 1.5 in favor of a WP core function.
    7878 *
    7979 * @deprecated 1.5.0
    8080 * @deprecated Use add_menu_page().
     
    341341                if ( !groups_is_user_member( $receiver_user_id, $group_id ) )
    342342                        continue;
    343343
    344                 // Now email the user with the contents of the message (if they have enabled email notifications)
     344                // Now email the user with the contents of the message (if they have enabled email notifications).
    345345                if ( 'no' != bp_get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) {
    346346                        $poster_name = bp_core_get_user_displayname( $poster_user_id );
    347347
     
    352352                        $poster_name = stripslashes( $poster_name );
    353353                        $content = bp_groups_filter_kses( stripslashes( $content ) );
    354354
    355                         // Set up and send the message
     355                        // Set up and send the message.
    356356                        $ud = bp_core_get_core_userdata( $receiver_user_id );
    357357                        $to = $ud->user_email;
    358358                        $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%1$s mentioned you in the group "%2$s"', 'buddypress' ), $poster_name, $group->name ) ) );
  • src/bp-core/deprecated/1.6.php

     
    77 * @deprecated 1.6.0
    88 */
    99
    10 // Exit if accessed directly
     10// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    1212
    1313/** Toolbar functions *********************************************************/
     
    224224        function bp_die_legacy_ajax_callbacks() {
    225225
    226226                // This is a list of the BP wp_ajax_ hook suffixes whose associated functions did
    227                 // not die properly before BP 1.6
     227                // not die properly before BP 1.6.
    228228                $actions = array(
    229                         // Directory template loaders
     229                        // Directory template loaders.
    230230                        'members_filter',
    231231                        'groups_filter',
    232232                        'blogs_filter',
     
    233233                        'forums_filter',
    234234                        'messages_filter',
    235235
    236                         // Activity
     236                        // Activity.
    237237                        'activity_widget_filter',
    238238                        'activity_get_older_updates',
    239239                        'post_update',
     
    245245                        'activity_mark_fav',
    246246                        'activity_mark_unfav',
    247247
    248                         // Groups
     248                        // Groups.
    249249                        'groups_invite_user',
    250250                        'joinleave_group',
    251251
    252                         // Members
     252                        // Members.
    253253                        'addremove_friend',
    254254                        'accept_friendship',
    255255                        'reject_friendship',
    256256
    257                         // Messages
     257                        // Messages.
    258258                        'messages_close_notice',
    259259                        'messages_send_reply',
    260260                        'messages_markunread',
     
    263263                        'messages_autocomplete_results'
    264264                );
    265265
    266                 // For each of the problematic hooks, exit at the very end of execution
     266                // For each of the problematic hooks, exit at the very end of execution.
    267267                foreach( $actions as $action ) {
    268268                        add_action( 'wp_ajax_' . $action, function() {
    269269                                exit;
  • src/bp-core/deprecated/1.7.php

     
    77 * @deprecated Since 1.7.0
    88 */
    99
    10 // Exit if accessed directly
     10// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    1212
    1313/**
     
    153153                bp_core_add_illegal_names();
    154154        }
    155155
    156         // Update and remove the message threads table if it exists
     156        // Update and remove the message threads table if it exists.
    157157        if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_messages_threads%'" ) ) {
    158158                if ( BP_Messages_Thread::update_tables() ) {
    159159                        $wpdb->query( "DROP TABLE {$bp_prefix}bp_messages_threads" );
  • src/bp-core/deprecated/1.9.php

     
    99 * @subpackage MembersNotifications
    1010 */
    1111
    12 // Exit if accessed directly
     12// Exit if accessed directly.
    1313defined( 'ABSPATH' ) || exit;
    1414
    1515/**
     
    3030 */
    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
     33        // Bail if notifications is not active.
    3434        if ( ! bp_is_active( 'notifications' ) ) {
    3535                return false;
    3636        }
    3737
    38         // Trigger the deprecated function notice
     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,
    4949                'user_id'           => $user_id,
     
    6868 */
    6969function bp_core_delete_notification( $id ) {
    7070
    71         // Bail if notifications is not active
     71        // Bail if notifications is not active.
    7272        if ( ! bp_is_active( 'notifications' ) ) {
    7373                return false;
    7474        }
    7575
    76         // Trigger the deprecated function notice
     76        // Trigger the deprecated function notice.
    7777        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notification()' );
    7878
    7979        return BP_Notifications_Notification::delete_by_id( $id );
     
    9191 */
    9292function bp_core_get_notification( $id ) {
    9393
    94         // Bail if notifications is not active
     94        // Bail if notifications is not active.
    9595        if ( ! bp_is_active( 'notifications' ) ) {
    9696                return false;
    9797        }
    9898
    99         // Trigger the deprecated function notice
     99        // Trigger the deprecated function notice.
    100100        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_get_notification()' );
    101101
    102102        return bp_notifications_get_notification( $id );
     
    115115 */
    116116function bp_core_get_notifications_for_user( $user_id, $format = 'string' ) {
    117117
    118         // Bail if notifications is not active
     118        // Bail if notifications is not active.
    119119        if ( ! bp_is_active( 'notifications' ) ) {
    120120                return false;
    121121        }
    122122
    123         // Trigger the deprecated function notice
     123        // Trigger the deprecated function notice.
    124124        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_get_notifications_for_user()' );
    125125
    126126        return bp_notifications_get_notifications_for_user( $user_id, $format );
     
    145145 */
    146146function bp_core_delete_notifications_by_type( $user_id, $component_name, $component_action ) {
    147147
    148         // Bail if notifications is not active
     148        // Bail if notifications is not active.
    149149        if ( ! bp_is_active( 'notifications' ) ) {
    150150                return false;
    151151        }
    152152
    153         // Trigger the deprecated function notice
     153        // Trigger the deprecated function notice.
    154154        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notifications_by_type()' );
    155155
    156156        return bp_notifications_delete_notifications_by_type( $user_id, $component_name, $component_action );
     
    174174 */
    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
     177        // Bail if notifications is not active.
    178178        if ( ! bp_is_active( 'notifications' ) ) {
    179179                return false;
    180180        }
    181181
    182         // Trigger the deprecated function notice
     182        // Trigger the deprecated function notice.
    183183        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notifications_by_item_id()' );
    184184
    185185        return bp_notifications_delete_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id );
     
    200200 */
    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
     203        // Bail if notifications is not active.
    204204        if ( ! bp_is_active( 'notifications' ) ) {
    205205                return false;
    206206        }
    207207
    208         // Trigger the deprecated function notice
     208        // Trigger the deprecated function notice.
    209209        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_all_notifications_by_type()' );
    210210
    211211        bp_notifications_delete_all_notifications_by_type( $item_id, $component_name, $component_action, $secondary_item_id );
     
    214214/**
    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
    220220 *             bp_notifications_delete_notifications_from_user() instead.
     
    227227 */
    228228function bp_core_delete_notifications_from_user( $user_id, $component_name, $component_action ) {
    229229
    230         // Bail if notifications is not active
     230        // Bail if notifications is not active.
    231231        if ( ! bp_is_active( 'notifications' ) ) {
    232232                return false;
    233233        }
    234234
    235         // Trigger the deprecated function notice
     235        // Trigger the deprecated function notice.
    236236        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_delete_notifications_from_user()' );
    237237
    238238        return bp_notifications_delete_notifications_from_user( $user_id, $component_name, $component_action );
     
    255255 */
    256256function bp_core_check_notification_access( $user_id, $notification_id ) {
    257257
    258         // Bail if notifications is not active
     258        // Bail if notifications is not active.
    259259        if ( ! bp_is_active( 'notifications' ) ) {
    260260                return false;
    261261        }
    262262
    263         // Trigger the deprecated function notice
     263        // Trigger the deprecated function notice.
    264264        _deprecated_function( __FUNCTION__, '1.9', 'bp_notifications_check_notification_access()' );
    265265
    266266        return bp_notifications_check_notification_access( $user_id, $notification_id );