Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/15/2014 04:30:55 AM (8 years ago)
Author:
netweb
Message:

Replies now use the reply ID for the the post name/slug via r5117.
bbPress' importers should also reflect that change with the removal of 'Reply Title' (post_title), 'Reply Slug' (post_name) and callback_reply_title from all importers. Props netweb. Fixes #2585

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/converters/SimplePress5.php

    r5170 r5349  
    307307        );
    308308
    309         // Reply title.
    310         // Note: We join the sftopics table because sfposts table does not include topic title.
    311         $this->field_map[] = array(
    312             'from_tablename'  => 'sftopics',
    313             'from_fieldname'  => 'topic_name',
    314             'join_tablename'  => 'sfposts',
    315             'join_type'       => 'LEFT',
    316             'join_expression' => 'USING (topic_id) WHERE sfposts.post_index != 1',
    317             'to_type'         => 'reply',
    318             'to_fieldname'    => 'post_title',
    319             'callback_method' => 'callback_reply_title'
    320         );
    321 
    322         // Reply slug (Clean name to avoid conflicts)
    323         // Note: We join the sftopics table because sfposts table does not include topic title.
    324         $this->field_map[] = array(
    325             'from_tablename'  => 'sftopics',
    326             'from_fieldname'  => 'topic_name',
    327             'join_tablename'  => 'sfposts',
    328             'join_type'       => 'LEFT',
    329             'join_expression' => 'USING (topic_id) WHERE sfposts.post_index != 1',
    330             'to_type'         => 'reply',
    331             'to_fieldname'    => 'post_name',
    332             'callback_method' => 'callback_slug'
    333         );
    334 
    335309        // Reply content.
    336310        $this->field_map[] = array(
     
    526500        $count = absint( (int) $count - 1 );
    527501        return $count;
    528     }
    529 
    530     /**
    531      * Set the reply title
    532      *
    533      * @param string $title Simple:Press v5.x topic title of this reply
    534      * @return string Prefixed topic title, or empty string
    535      */
    536     public function callback_reply_title( $title = '' ) {
    537         $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : '';
    538         return $title;
    539502    }
    540503
Note: See TracChangeset for help on using the changeset viewer.