Skip to:
Content

bbPress.org

Changeset 4487


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

Extract:

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

Legend:

Unmodified
Added
Removed
  • trunk/includes/core/update.php

    r4439 r4487  
    159159function bbp_create_initial_content( $args = array() ) {
    160160
    161     $defaults = array(
     161    $r = bbp_parse_args( $args, array(
    162162        'forum_parent'  => 0,
    163163        'forum_status'  => 'publish',
     
    168168        'reply_title'   => __( 'Re: Hello World!',                         'bbpress' ),
    169169        'reply_content' => __( 'Oh, and this is what a reply looks like.', 'bbpress' ),
    170     );
    171     $r = bbp_parse_args( $args, $defaults, 'create_initial_content' );
    172     extract( $r );
     170    ), 'create_initial_content' );
    173171
    174172    // Create the initial forum
    175173    $forum_id = bbp_insert_forum( array(
    176         'post_parent'  => $forum_parent,
    177         'post_status'  => $forum_status,
    178         'post_title'   => $forum_title,
    179         'post_content' => $forum_content
     174        'post_parent'  => $r['forum_parent'],
     175        'post_status'  => $r['forum_status'],
     176        'post_title'   => $r['forum_title'],
     177        'post_content' => $r['forum_content']
    180178    ) );
    181179
     
    183181    $topic_id = bbp_insert_topic(
    184182        array(
    185             'post_parent'  => $forum_id,
    186             'post_title'   => $topic_title,
    187             'post_content' => $topic_content
     183            'post_parent'  => forum_id,
     184            'post_title'   => $r['topic_title'],
     185            'post_content' => $r['topic_content']
    188186        ),
    189187        array( 'forum_id'  => $forum_id )
     
    194192        array(
    195193            'post_parent'  => $topic_id,
    196             'post_title'   => $reply_title,
    197             'post_content' => $reply_content
     194            'post_title'   => $r['reply_title'],
     195            'post_content' => $r['reply_content']
    198196        ),
    199197        array(
Note: See TracChangeset for help on using the changeset viewer.