Skip to:
Content

bbPress.org

Changeset 4503


Ignore:
Timestamp:
11/24/2012 07:19:06 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Extract:

  • Remove extract() from bbp_list_forums().
  • See #2056.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/forums/template-tags.php

    r4502 r4503  
    677677
    678678    // Defaults and arguments
    679     $defaults = array (
     679    $r = bbp_parse_args( $args, array(
    680680        'before'            => '<ul class="bbp-forums-list">',
    681681        'after'             => '</ul>',
     
    689689        'show_topic_count'  => true,
    690690        'show_reply_count'  => true,
    691     );
    692     $r = bbp_parse_args( $args, $defaults, 'list_forums' );
    693     extract( $r, EXTR_SKIP );
     691    ), 'list_forums' );
    694692
    695693    // Bail if there are no subforums
    696     if ( !bbp_get_forum_subforum_count( $forum_id, false ) )
     694    if ( !bbp_get_forum_subforum_count( $r['forum_id'], false ) )
    697695        return;
    698696
    699697    // Loop through forums and create a list
    700     $sub_forums = bbp_forum_get_subforums( $forum_id );
     698    $sub_forums = bbp_forum_get_subforums( $r['forum_id'] );
    701699    if ( !empty( $sub_forums ) ) {
    702700
     
    708706            // Get forum details
    709707            $count     = array();
    710             $show_sep  = $total_subs > $i ? $separator : '';
     708            $show_sep  = $total_subs > $i ? $r['separator'] : '';
    711709            $permalink = bbp_get_forum_permalink( $sub_forum->ID );
    712710            $title     = bbp_get_forum_title( $sub_forum->ID );
    713711
    714712            // Show topic count
    715             if ( !empty( $show_topic_count ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
     713            if ( !empty( $r['show_topic_count'] ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
    716714                $count['topic'] = bbp_get_forum_topic_count( $sub_forum->ID );
    717715            }
    718716
    719717            // Show reply count
    720             if ( !empty( $show_reply_count ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
     718            if ( !empty( $r['show_reply_count'] ) && !bbp_is_forum_category( $sub_forum->ID ) ) {
    721719                $count['reply'] = bbp_get_forum_reply_count( $sub_forum->ID );
    722720            }
     
    724722            // Counts to show
    725723            if ( !empty( $count ) ) {
    726                 $counts = $count_before . implode( $count_sep, $count ) . $count_after;
     724                $counts = $r['count_before'] . implode( $r['count_sep'], $count ) . $r['count_after'];
    727725            }
    728726
    729727            // Build this sub forums link
    730             $output .= $link_before . '<a href="' . $permalink . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $link_after;
     728            $output .= $r['link_before'] . '<a href="' . $permalink . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $r['link_after'];
    731729        }
    732730
    733731        // Output the list
    734         echo apply_filters( 'bbp_list_forums', $before . $output . $after, $args );
     732        echo apply_filters( 'bbp_list_forums', $r['before'] . $output . $r['after'], $r );
    735733    }
    736734}
Note: See TracChangeset for help on using the changeset viewer.