Skip to:
Content

BuddyPress.org

Changeset 12669


Ignore:
Timestamp:
06/16/2020 05:24:41 AM (4 years ago)
Author:
imath
Message:

BP Nouveau: make sure to format the total objects count once only

This is a follow up of [12619] & [12634] to apply the fix to the "my blogs", "my notifications", "my groups" and "my friends" count.

props etatus

See #8311 (Branch 6.0)

Location:
branches/6.0/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/6.0/src/bp-blogs/classes/class-bp-blogs-component.php

    r12611 r12669  
    225225                '<span class="%s">%s</span>',
    226226                esc_attr( $class ),
    227                 bp_core_number_format( $count )
     227                esc_html( $count )
    228228            )
    229229        );
  • branches/6.0/src/bp-friends/bp-friends-filters.php

    r12416 r12669  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
     12
     13// Format numerical output.
     14add_filter( 'friends_get_total_friend_count', 'bp_core_number_format' );
     15add_filter( 'bp_get_total_friend_count',      'bp_core_number_format' );
    1216
    1317/**
  • branches/6.0/src/bp-friends/bp-friends-template.php

    r12589 r12669  
    650650        return apply_filters( 'bp_get_total_friend_count', friends_get_total_friend_count( $user_id ), $user_id );
    651651    }
    652     add_filter( 'bp_get_total_friend_count', 'bp_core_number_format' );
    653652
    654653/**
  • branches/6.0/src/bp-friends/classes/class-bp-friends-component.php

    r12607 r12669  
    177177                '<span class="%s">%s</span>',
    178178                esc_attr( $class ),
    179                 bp_core_number_format( $count )
     179                esc_html( $count )
    180180            )
    181181        );
  • branches/6.0/src/bp-notifications/bp-notifications-filters.php

    r12416 r12669  
    11<?php
    22/**
    3  * Filters related to the Activity component.
     3 * Filters related to the Notifications component.
    44 *
    55 * @package BuddyPress
     
    77 * @since 4.0.0
    88 */
     9
     10
     11// Format numerical output.
     12add_filter( 'bp_notifications_get_total_notification_count', 'bp_core_number_format' );
    913
    1014// Privacy data export.
  • branches/6.0/src/bp-notifications/classes/class-bp-notifications-component.php

    r12463 r12669  
    165165                    '<span class="%s">%s</span>',
    166166                    esc_attr( $class ),
    167                     bp_core_number_format( $count )
     167                    esc_html( $count )
    168168                )
    169169            );
  • branches/6.0/src/bp-templates/bp-nouveau/includes/blogs/loader.php

    r12192 r12669  
    44 *
    55 * @since 3.0.0
     6 * @version 6.1.0
    67 */
    78
     
    8990            // Add controls into the Blogs sections of the customizer.
    9091            add_filter( 'bp_nouveau_customizer_controls', 'bp_nouveau_blogs_customizer_controls', 11, 1 );
     92
     93            // The number formatting is done into the `bp_nouveau_nav_count()` template tag.
     94            remove_filter( 'bp_get_total_blog_count_for_user', 'bp_core_number_format' );
    9195        }
    9296    }
  • branches/6.0/src/bp-templates/bp-nouveau/includes/friends/loader.php

    r12192 r12669  
    44 *
    55 * @since 3.0.0
    6  * @version 3.0.0
     6 * @version 6.1.0
    77 */
    88
     
    8888            add_filter( 'bp_button_' . $button, 'bp_nouveau_ajax_button', 10, 5 );
    8989        }
     90
     91        // The number formatting is done into the `bp_nouveau_nav_count()` template tag.
     92        remove_filter( 'friends_get_total_friend_count', 'bp_core_number_format' );
     93        remove_filter( 'bp_get_total_friend_count',      'bp_core_number_format' );
    9094    }
    9195
  • branches/6.0/src/bp-templates/bp-nouveau/includes/groups/loader.php

    r12634 r12669  
    44 *
    55 * @since 3.0.0
    6  * @version 6.0.0
     6 * @version 6.1.0
    77 */
    88
     
    134134        // The number formatting is done into the `bp_nouveau_nav_count()` template tag.
    135135        remove_filter( 'bp_get_total_group_count', 'bp_core_number_format' );
     136        remove_filter( 'bp_get_total_group_count_for_user', 'bp_core_number_format' );
    136137    }
    137138
  • branches/6.0/src/bp-templates/bp-nouveau/includes/notifications/loader.php

    r12082 r12669  
    44 *
    55 * @since 3.0.0
    6  * @version 3.0.0
     6 * @version 6.1.0
    77 */
    88
     
    8888        add_filter( 'bp_get_the_notification_mark_read_link', 'bp_nouveau_notifications_mark_read_link', 10, 1 );
    8989        add_filter( 'bp_get_the_notification_delete_link', 'bp_nouveau_notifications_delete_link', 10, 1 );
     90
     91        // The number formatting is done into the `bp_nouveau_nav_count()` template tag.
     92        remove_filter( 'bp_notifications_get_total_notification_count', 'bp_core_number_format' );
    9093    }
    9194}
Note: See TracChangeset for help on using the changeset viewer.