Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/05/2024 05:54:33 PM (12 months ago)
Author:
johnjamesjacoby
Message:

Common: prefer bbp_get_topic_permalink() over get_permalink()

This change ensures that features like Subscriptions & Pagination (inside of topics list loops) have: an opportunity to use the anticipated function path, and access to the right filters when including links back to them.

This fixes a potential bug where filtering a topic permalink would not happen inside of emails or pagination in the loop-topic template part.

See #3603.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/topics/template.php

    r7276 r7279  
    809809        $has_slug = bbp_get_topic( $r['topic_id'] )->post_name;
    810810
     811        // Get the topic permalink
     812        $topic_permalink = bbp_get_topic_permalink( $r['topic_id'] );
     813
    811814        // If pretty permalinks are enabled, make our pagination pretty
    812815        $base = ! empty( $has_slug ) && bbp_use_pretty_urls() && bbp_is_topic_public( $r['topic_id'] )
    813             ? trailingslashit( get_permalink( $r['topic_id'] ) ) . user_trailingslashit( bbp_get_paged_slug() . '/%#%/' )
    814             : add_query_arg( 'paged', '%#%', get_permalink( $r['topic_id'] ) );
     816            ? trailingslashit( $topic_permalink ) . user_trailingslashit( bbp_get_paged_slug() . '/%#%/' )
     817            : add_query_arg( 'paged', '%#%', $topic_permalink );
    815818
    816819        // Get total and add 1 if topic is included in the reply loop
Note: See TracChangeset for help on using the changeset viewer.