Skip to:
Content

bbPress.org

Changeset 5176


Ignore:
Timestamp:
11/23/2013 01:00:51 PM (13 years ago)
Author:
netweb
Message:

Include support for custom topic tag slugs and descriptions during import. Props netweb. Fixes #2399

  • Support included for bbPress v1.x , Drupal, Example, PHPFox, vBulletin v3.x & v4.x
Location:
trunk/includes/admin
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/admin/converter.php

    r5170 r5176  
    980980                                                        case 'tags':
    981981                                                                $post_id = wp_set_object_terms( $insert_postmeta['objectid'], $insert_postmeta['name'], 'topic-tag', true );
    982                                                                 break;
     982                                                                $term = get_term_by( 'name', $insert_postmeta['name'], 'topic-tag');
     983                                                                if ( false !== $term ) {
     984                                                                        wp_update_term( $term->term_id, 'topic-tag', array(
     985                                                                                'description' => $insert_postmeta['description'],
     986                                                                                'slug'        => $insert_postmeta['slug']
     987                                                                        ) );
     988                                                                }
     989                                                                break;
    983990
    984991                                                        /** Forum, Topic, Reply ***************************/
  • trunk/includes/admin/converters/Drupal7.php

    r5170 r5176  
    279279                );
    280280
    281                 /* Pending: 'Topic-Tag' Descriptions & Slugs with bbPress Importer
    282                 /* Pending: http://bbpress.trac.wordpress.org/ticket/2399
    283 
    284281                // Term slug.
     282                $this->field_map[] = array(
     283                        'from_tablename'  => 'taxonomy_term_data',
     284                        'from_fieldname'  => 'name',
     285                        'join_tablename'  => 'field_data_field_tags',
     286                        'join_type'       => 'INNER',
     287                        'join_expression' => 'ON field_tags_tid = taxonomy_term_data.tid',
     288                        'to_type'         => 'tags',
     289                        'to_fieldname'    => 'slug',
     290                        'callback_method' => 'callback_slug'
     291                );
     292
     293                // Term description.
    285294                $this->field_map[] = array(
    286295                        'from_tablename'  => 'taxonomy_term_data',
    … …  
    290299                        'join_expression' => 'ON field_tags_tid = taxonomy_term_data.tid',
    291300                        'to_type'         => 'tags',
    292                         'to_fieldname'    => 'slug'
    293                 );
    294 
    295                 // Term description.
    296                 $this->field_map[] = array(
    297                         'from_tablename'  => 'taxonomy_term_data',
    298                         'from_fieldname'  => 'description',
    299                         'join_tablename'  => 'field_data_field_tags',
    300                         'join_type'       => 'INNER',
    301                         'join_expression' => 'ON field_tags_tid = taxonomy_term_data.tid',
    302                         'to_type'         => 'tags',
    303301                        'to_fieldname'    => 'description'
    304302                );
    305                 */
    306303
    307304                /** Reply Section *****************************************************/
  • trunk/includes/admin/converters/Example.php

    r5170 r5176  
    330330                );
    331331
     332                // Term slug.
     333                $this->field_map[] = array(
     334                        'from_tablename'  => 'tag_table',
     335                        'from_fieldname'  => 'tagslug',
     336                        'to_type'         => 'tags',
     337                        'to_fieldname'    => 'slug',
     338                        'callback_method' => 'callback_slug'
     339                );
     340
     341                // Term description.
     342                $this->field_map[] = array(
     343                        'from_tablename'  => 'tag_table',
     344                        'from_fieldname'  => 'tagdescription',
     345                        'to_type'         => 'tags',
     346                        'to_fieldname'    => 'description'
     347                );
     348
    332349                /** Reply Section *****************************************************/
    333350
  • trunk/includes/admin/converters/PHPFox3.php

    r5170 r5176  
    316316                );
    317317
     318                // Term slug.
     319                $this->field_map[] = array(
     320                        'from_tablename'  => 'tag',
     321                        'from_fieldname'  => 'tag_url',
     322                        'to_type'         => 'tags',
     323                        'to_fieldname'    => 'slug',
     324                        'callback_method' => 'callback_slug'
     325                );
     326
    318327                /** Reply Section *****************************************************/
    319328
  • trunk/includes/admin/converters/bbPress1.php

    r5170 r5176  
    325325                );
    326326
     327                // Term slug.
     328                $this->field_map[] = array(
     329                        'from_tablename'  => 'terms',
     330                        'from_fieldname'  => 'slug',
     331                        'join_tablename'  => 'term_taxonomy',
     332                        'join_type'       => 'INNER',
     333                        'join_expression' => 'USING (term_id)',
     334                        'to_type'         => 'tags',
     335                        'to_fieldname'    => 'slug',
     336                        'callback_method' => 'callback_slug'
     337                );
     338
    327339                /** Reply Section *****************************************************/
    328340
  • trunk/includes/admin/converters/vBulletin.php

    r5170 r5176  
    319319                        'to_type'         => 'tags',
    320320                        'to_fieldname'    => 'name'
     321                );
     322
     323                // Term slug.
     324                $this->field_map[] = array(
     325                        'from_tablename'  => 'tag',
     326                        'from_fieldname'  => 'tagtext',
     327                        'join_tablename'  => 'tagcontent',
     328                        'join_type'       => 'INNER',
     329                        'join_expression' => 'USING (tagid)',
     330                        'to_type'         => 'tags',
     331                        'to_fieldname'    => 'slug',
     332                        'callback_method' => 'callback_slug'
    321333                );
    322334
  • trunk/includes/admin/converters/vBulletin3.php

    r5170 r5176  
    319319                        'to_type'         => 'tags',
    320320                        'to_fieldname'    => 'name'
     321                );
     322
     323                // Term slug.
     324                $this->field_map[] = array(
     325                        'from_tablename'  => 'tag',
     326                        'from_fieldname'  => 'tagtext',
     327                        'join_tablename'  => 'tagthread',
     328                        'join_type'       => 'INNER',
     329                        'join_expression' => 'USING (tagid)',
     330                        'to_type'         => 'tags',
     331                        'to_fieldname'    => 'slug',
     332                        'callback_method' => 'callback_slug'
    321333                );
    322334
Note: See TracChangeset for help on using the changeset viewer.