Skip to:
Content

bbPress.org

Opened 8 years ago

Closed 7 years ago

#2399 closed enhancement (fixed)

Include 'Topic-Tag' Descriptions & Slugs with bbPress Importer

Reported by: netweb Owned by: netweb
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.4.1
Component: API - Importers Keywords: has-patch
Cc:

Description

bbPress importer converter.php 'Tags Section' only imports 'topic'tag' taxonomy data fields:

  • 'Topic Tag' Topic id. objectid
  • 'Topic Tag' Taxonomy ID. taxonomy
  • 'Topic Tag' Term name. name

Include extra taxonomy data when avaiable

  • 'Topic Tag' slug in wp_terms
  • 'Topic Tag' description in wp_term_taxonomy

http://bbpress.trac.wordpress.org/browser/trunk/includes/admin/converter.php#L928

http://codex.wordpress.org/Function_Reference/wp_set_object_terms
http://codex.wordpress.org/Function_Reference/wp_set_post_terms
http://codex.wordpress.org/Function_Reference/add_metadata

Attachments (1)

2399.diff (6.0 KB) - added by netweb 7 years ago.

Download all attachments as: .zip

Change History (6)

#1 @johnjamesjacoby
8 years ago

  • Milestone changed from Awaiting Review to 2.5

Good call. Let's try to do this in 2.5.

#2 @netweb
7 years ago

Leaving this here for now... I think its something like this that is needed, though that something should work, this does not!

  • bbPress/includes/admin/converter.php

    diff --git a/bbPress/includes/admin/converter.php b/bbPress/includes/admin/converter.php
    index 2588109..af6944b 100644
    a b abstract class BBP_Converter_Base { 
    949949
    950950                                                        case 'tags':
    951951                                                                $post_id = wp_set_object_terms( $insert_postmeta['objectid'], $insert_postmeta['name'], 'topic-tag', true );
     952
     953                                                                if ( ( 'tags' == $to_type ) && ( 'description' == $key ) ) {
     954                                                                        $term = get_term_by( 'name', $insert_postmeta['name'], 'topic-tag')
     955                                                                        $termid = $term->term_id;
     956                                                                        wp_update_term( $termid, 'topic-tag'], array( 'description' => $insert_postmeta['description'] ));
     957                                                                }
     958
     959                                                                if ( ( 'tags' == $to_type ) && ( 'slug' == $key ) ) {
     960                                                                        $term = get_term_by( 'name', $insert_postmeta['name'], 'topic-tag')
     961                                                                        $term_id = $term->term_id;
     962                                                                        wp_update_term( $term_id, 'topic-tag'], array( 'slug' => $insert_postmeta['slug'] ));
     963                                                                }
    952964                                                                break;
    953965
    954966                                                        /** Forum, Topic, Reply ***************************/

@netweb
7 years ago

#3 @netweb
7 years ago

  • Keywords has-patch added; needs-patch removed
  • Version changed from 2.3.2 to 2.4.1

In 2399.diff

  • Add support for importing taxonomy topic-tag term slug and description
  • Import bbPress1 topic-tag slug
  • Import Drupal7 topic-tag slug and description
  • Import Example topic-tag slug and description
  • Import PHPFox3 topic-tag slug
  • Import vBulletin topic-tag slug
  • Import vBulletin3 topic-tag slug

#4 @netweb
7 years ago

  • Owner set to netweb

#5 @netweb
7 years ago

  • Resolution set to fixed
  • Status changed from new to closed

In 5176:

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
Note: See TracTickets for help on using tickets.