Skip to:
Content

bbPress.org

Changeset 4488


Ignore:
Timestamp:
11/23/2012 11:24:47 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Extract:

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

Legend:

Unmodified
Added
Removed
  • trunk/includes/forums/functions.php

    r4258 r4488  
    14731473 */
    14741474function bbp_update_forum( $args = '' ) {
    1475     $defaults = array(
     1475
     1476    // Parse arguments with default values
     1477    $r = bbp_parse_args( $args, array(
    14761478        'forum_id'           => 0,
    14771479        'post_parent'        => 0,
     
    14811483        'last_active_time'   => 0,
    14821484        'last_active_status' => bbp_get_public_status_id()
    1483     );
    1484     $r = bbp_parse_args( $args, $defaults, 'update_forum' );
    1485     extract( $r );
     1485    ), 'update_forum' );
    14861486
    14871487    // Last topic and reply ID's
    1488     bbp_update_forum_last_topic_id( $forum_id, $last_topic_id );
    1489     bbp_update_forum_last_reply_id( $forum_id, $last_reply_id );
     1488    bbp_update_forum_last_topic_id( $r['forum_id'], $r['last_topic_id'] );
     1489    bbp_update_forum_last_reply_id( $r['forum_id'], $r['last_reply_id'] );
    14901490
    14911491    // Active dance
    1492     $last_active_id = bbp_update_forum_last_active_id( $forum_id, $last_active_id );
     1492    $r['last_active_id'] = bbp_update_forum_last_active_id( $r['forum_id'], $r['last_active_id'] );
    14931493
    14941494    // If no active time was passed, get it from the last_active_id
    1495     if ( empty( $last_active_time ) )
    1496         $last_active_time = get_post_field( 'post_date', $last_active_id );
    1497 
    1498     if ( bbp_get_public_status_id() == $last_active_status ) {
    1499         bbp_update_forum_last_active_time( $forum_id, $last_active_time );
     1495    if ( empty( $r['last_active_time'] ) ) {
     1496        $r['last_active_time'] = get_post_field( 'post_date', $r['last_active_id'] );
     1497    }
     1498
     1499    if ( bbp_get_public_status_id() == $r['last_active_status'] ) {
     1500        bbp_update_forum_last_active_time( $r['forum_id'], $r['last_active_time'] );
    15001501    }
    15011502
    15021503    // Counts
    1503     bbp_update_forum_subforum_count    ( $forum_id );
    1504     bbp_update_forum_reply_count       ( $forum_id );
    1505     bbp_update_forum_topic_count       ( $forum_id );
    1506     bbp_update_forum_topic_count_hidden( $forum_id );
     1504    bbp_update_forum_subforum_count    ( $r['forum_id'] );
     1505    bbp_update_forum_reply_count       ( $r['forum_id'] );
     1506    bbp_update_forum_topic_count       ( $r['forum_id'] );
     1507    bbp_update_forum_topic_count_hidden( $r['forum_id'] );
    15071508
    15081509    // Update the parent forum if one was passed
    1509     if ( !empty( $post_parent ) && is_numeric( $post_parent ) ) {
     1510    if ( !empty( $r['post_parent'] ) && is_numeric( $r['post_parent'] ) ) {
    15101511        bbp_update_forum( array(
    1511             'forum_id'    => $post_parent,
    1512             'post_parent' => get_post_field( 'post_parent', $post_parent )
     1512            'forum_id'    => $r['post_parent'],
     1513            'post_parent' => get_post_field( 'post_parent', $r['post_parent'] )
    15131514        ) );
    15141515    }
Note: See TracChangeset for help on using the changeset viewer.