WordPress.org

Make WordPress Core

Ticket #27896: 27896.diff

File 27896.diff, 786 bytes (added by pbiron, 5 years ago)

fixes bug whereby termmeta is not imported when the WXR_Parser_XML is used

  • parsers.php

    From fb712dd20b090258186ea33d5a9fba66cc4a9e6f Mon Sep 17 00:00:00 2001
    From: Paul Biron <paul@sparrowhawkcomputing.com>
    Date: Tue, 6 Jun 2017 14:10:28 -0600
    Subject: [PATCH] correctly parse termmeta when WXR_Parser_XML is used
    
    ---
     parsers.php | 5 +++++
     1 file changed, 5 insertions(+)
    
    diff --git a/parsers.php b/parsers.php
    index fab101e..35513fe 100644
    a b class WXR_Parser_XML { 
    384384                                        $this->data['postmeta'][] = $this->sub_data;
    385385                                $this->sub_data = false;
    386386                                break;
     387                        case 'wp:termmeta':
     388                                if ( ! empty( $this->sub_data ) )
     389                                        $this->data['termmeta'][] = $this->sub_data;
     390                                $this->sub_data = false;
     391                                break;
    387392                        case 'item':
    388393                                $this->posts[] = $this->data;
    389394                                $this->data = false;