Skip to:
Content

BuddyPress.org

Changeset 14001


Ignore:
Timestamp:
08/09/2024 01:34:14 PM (2 years ago)
Author:
espellcaste
Message:

Fix: Corrected argument mismatch in printf() function in the Legacy Template pack.

Addressed an issue where the printf() function in the BuddyPress Legacy Template was causing errors in PHP 7.4.33 and PHP 8.0.30 due to an incorrect number of arguments.

Props venutius, mike80222, imath, emaralive.

See #9221 (trunk)
Closes https://github.com/buddypress/buddypress/pull/355

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress/activity/index.php

    r13822 r14001  
    2626         * @since 1.2.0
    2727         */
    28         do_action( 'bp_before_directory_activity_content' ); ?>
     28        do_action( 'bp_before_directory_activity_content' );
     29        ?>
    2930
    3031        <?php if ( is_user_logged_in() ) : ?>
     
    4243                 * @since 1.0.0
    4344                 */
    44                 do_action( 'template_notices' ); ?>
     45                do_action( 'template_notices' );
     46                ?>
    4547
    4648        </div>
     
    5557                         * @since 1.2.0
    5658                         */
    57                         do_action( 'bp_before_activity_type_tab_all' ); ?>
     59                        do_action( 'bp_before_activity_type_tab_all' );
     60                        ?>
    5861
    5962                        <li class="selected" id="activity-all">
     
    7578                                 * @since 1.2.0
    7679                                 */
    77                                 do_action( 'bp_before_activity_type_tab_friends' ); ?>
     80                                do_action( 'bp_before_activity_type_tab_friends' );
     81                                ?>
    7882
    7983                                <?php if ( bp_is_active( 'friends' ) ) : ?>
     
    101105                                 * @since 1.2.0
    102106                                 */
    103                                 do_action( 'bp_before_activity_type_tab_groups' ); ?>
     107                                do_action( 'bp_before_activity_type_tab_groups' );
     108                                ?>
    104109
    105110                                <?php if ( bp_is_active( 'groups' ) ) : ?>
     
    127132                                 * @since 1.2.0
    128133                                 */
    129                                 do_action( 'bp_before_activity_type_tab_favorites' ); ?>
     134                                do_action( 'bp_before_activity_type_tab_favorites' );
     135                                ?>
    130136
    131137                                <?php if ( bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) : ?>
     
    151157                                         * @since 1.2.0
    152158                                         */
    153                                         do_action( 'bp_before_activity_type_tab_mentions' ); ?>
     159                                        do_action( 'bp_before_activity_type_tab_mentions' );
     160                                        ?>
    154161
    155162                                        <li id="activity-mentions">
     
    161168                                                                        <span>
    162169                                                                                <?php
    163                                                                                 /* translators: %s: new mentions count */
    164                                                                                 printf( esc_html( _nx( '%s new', '%s new', bp_get_total_mention_count_for_user( bp_loggedin_user_id() ), 'Number of new activity mentions', 'buddypress' ), esc_html( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) ) );
     170                                                                                $new_mentions_count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() );
     171
     172                                                                                printf(
     173                                                                                        esc_html(
     174                                                                                                /* translators: %s: new mentions count */
     175                                                                                                _nx(
     176                                                                                                        '%s new',
     177                                                                                                        '%s new',
     178                                                                                                        $new_mentions_count,
     179                                                                                                        'Number of new activity mentions',
     180                                                                                                        'buddypress'
     181                                                                                                )
     182                                                                                        ),
     183                                                                                        esc_html( $new_mentions_count )
     184                                                                                );
    165185                                                                                ?>
    166186                                                                        </span>
     
    181201                         * @since 1.2.0
    182202                         */
    183                         do_action( 'bp_activity_type_tabs' ); ?>
     203                        do_action( 'bp_activity_type_tabs' );
     204                        ?>
    184205                </ul>
    185206        </div><!-- .item-list-tabs -->
     
    202223                         * @since 1.2.0
    203224                         */
    204                         do_action( 'bp_activity_syndication_options' ); ?>
     225                        do_action( 'bp_activity_syndication_options' );
     226                        ?>
    205227
    206228                        <li id="activity-filter-select" class="last">
     
    218240                                         * @since 1.2.0
    219241                                         */
    220                                         do_action( 'bp_activity_filter_options' ); ?>
     242                                        do_action( 'bp_activity_filter_options' );
     243                                        ?>
    221244
    222245                                </select>
     
    232255         * @since 1.5.0
    233256         */
    234         do_action( 'bp_before_directory_activity_list' ); ?>
     257        do_action( 'bp_before_directory_activity_list' );
     258        ?>
    235259
    236260        <div class="activity" aria-live="polite" aria-atomic="true" aria-relevant="all">
     
    247271         * @since 1.5.0
    248272         */
    249         do_action( 'bp_after_directory_activity_list' ); ?>
     273        do_action( 'bp_after_directory_activity_list' );
     274        ?>
    250275
    251276        <?php
     
    254279         * Fires inside and displays the activity directory display content.
    255280         */
    256         do_action( 'bp_directory_activity_content' ); ?>
     281        do_action( 'bp_directory_activity_content' );
     282        ?>
    257283
    258284        <?php
     
    263289         * @since 1.2.0
    264290         */
    265         do_action( 'bp_after_directory_activity_content' ); ?>
     291        do_action( 'bp_after_directory_activity_content' );
     292        ?>
    266293
    267294        <?php
     
    272299         * @since 1.5.0
    273300         */
    274         do_action( 'bp_after_directory_activity' ); ?>
     301        do_action( 'bp_after_directory_activity' );
     302        ?>
    275303
    276304</div>
Note: See TracChangeset for help on using the changeset viewer.