Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/15/2015 09:30:40 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Widgets: Add class to forum widget to indicate if item in list is the current forum being viewed.

Props dimitrov.adrian, netweb. Fixes #2536.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/widgets.php

    r5829 r5845  
    585585            <?php while ( $widget_query->have_posts() ) : $widget_query->the_post(); ?>
    586586
    587                 <li><a class="bbp-forum-title" href="<?php bbp_forum_permalink( $widget_query->post->ID ); ?>"><?php bbp_forum_title( $widget_query->post->ID ); ?></a></li>
     587                <li <?php echo ( bbp_get_forum_id() === $widget_query->post->ID ? ' class="bbp-forum-widget-current-forum"' : '' ); ?>>
     588                    <a class="bbp-forum-title" href="<?php bbp_forum_permalink( $widget_query->post->ID ); ?>">
     589                        <?php bbp_forum_title( $widget_query->post->ID ); ?>
     590                    </a>
     591                </li>
    588592
    589593            <?php endwhile; ?>
Note: See TracChangeset for help on using the changeset viewer.