File tree 2 files changed +8
-3
lines changed
packages/playground/data-liberation/src
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,9 @@ public function next_step() {
194
194
if ( null !== $ this ->next_stage ) {
195
195
return false ;
196
196
}
197
+
198
+ do_action ( 'wp_stream_importer_next_stage ' , $ this );
199
+
197
200
switch ( $ this ->stage ) {
198
201
case self ::STAGE_INITIAL :
199
202
$ this ->next_stage = self ::STAGE_INDEX_ENTITIES ;
@@ -392,10 +395,11 @@ private function topological_sort_next_entity() {
392
395
// $cursor = $this->entity_iterator->get_reentrancy_cursor();
393
396
$ entity = $ this ->entity_iterator ->current ();
394
397
$ data = $ entity ->get_data ();
395
- $ offset = $ this ->entity_iterator ->get_entity_byte_offset ();
398
+ $ offset = $ this ->entity_iterator ->get_last_xml_byte_offset_outside_of_entity ();
396
399
397
400
switch ( $ entity ->get_type () ) {
398
401
case 'category ' :
402
+ file_put_contents ( 'php://stderr ' , print_r ( $ data , true ) );
399
403
$ this ->topological_sorter ->map_category ( $ offset , $ data );
400
404
break ;
401
405
case 'post ' :
Original file line number Diff line number Diff line change @@ -340,6 +340,7 @@ class WP_WXR_Reader implements Iterator {
340
340
'wp:category ' => array (
341
341
'type ' => 'category ' ,
342
342
'fields ' => array (
343
+ 'wp:term_id ' => 'term_id ' ,
343
344
'wp:category_nicename ' => 'slug ' ,
344
345
'wp:category_parent ' => 'parent ' ,
345
346
'wp:cat_name ' => 'name ' ,
@@ -396,8 +397,8 @@ protected function __construct( WP_XML_Processor $xml ) {
396
397
$ this ->xml = $ xml ;
397
398
}
398
399
399
- public function get_entity_byte_offset () {
400
- return $ this ->entity_byte_offset ;
400
+ public function get_last_xml_byte_offset_outside_of_entity () {
401
+ return $ this ->last_xml_byte_offset_outside_of_entity ;
401
402
}
402
403
403
404
public function get_reentrancy_cursor () {
You can’t perform that action at this time.
0 commit comments