Skip to:
Content

bbPress.org


Ignore:
Timestamp:
09/10/2011 10:27:19 PM (13 years ago)
Author:
johnjamesjacoby
Message:

API adjustments:

  • Refactor _status_ vars into callable functions.
  • Audit usage of $bbp global.
  • Perform get_class() checks on extensions to avoid errors if global $bbp is overloaded.
  • Bump DB version to 175.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-admin/importers/bbpress.php

    r3376 r3505  
    880880
    881881                $forum_map     = array();
    882                 $post_statuses = array( 'publish', $bbp->trash_status_id, $bbp->spam_status_id );
     882                $post_statuses = array( bbp_get_public_status_id(), bbp_get_trash_status_id(), bbp_get_spam_status_id() );
    883883
    884884                foreach ( (array) $forums as $forum ) {
     
    891891                        'post_title'     => $forum->forum_name,
    892892                        'post_excerpt'   => '',
    893                         'post_status'    => 'publish',
     893                        'post_status'    => bbp_get_public_status_id(),
    894894                        'comment_status' => 'closed',
    895895                        'ping_status'    => 'closed',
     
    944944
    945945                        // If the topic is public, check if it's open and set the status accordingly
    946                         $topic_status       =  $topic->topic_status == 0 ? ( $topic->topic_open == 0 ? $bbp->closed_status_id : $post_statuses[$topic->topic_status] ) : $post_statuses[$topic->topic_status];
     946                        $topic_status       =  $topic->topic_status == 0 ? ( $topic->topic_open == 0 ? bbp_get_closed_status_id() : $post_statuses[$topic->topic_status] ) : $post_statuses[$topic->topic_status];
    947947
    948948                        $inserted_topic     =  wp_insert_post( array(
     
    10381038
    10391039                            // Only add favorites and subscriptions if the topic is public
    1040                             if ( in_array( $topic_status, array( 'publish', $bbp->closed_status_id ) ) ) {
     1040                            if ( in_array( $topic_status, array( bbp_get_public_status_id(), bbp_get_closed_status_id() ) ) ) {
    10411041
    10421042                                // Favorites
Note: See TracChangeset for help on using the changeset viewer.