File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ public function categories() {
132132 ->tag ( 'wp:category_parent ' , $ category ->parent_slug )
133133 ->optional_cdata ( 'wp:cat_name ' , $ category ->name )
134134 ->optional_cdata ( 'wp:category_description ' , $ category ->description )
135+ ->oxymel ( $ this ->term_meta ( $ category ) )
135136 ->end ;
136137 }
137138 return $ oxymel ->to_string ();
@@ -256,6 +257,7 @@ protected function terms( $terms ) {
256257 $ oxymel
257258 ->optional_cdata ( 'wp:term_name ' , $ term ->name )
258259 ->optional_cdata ( 'wp:term_description ' , $ term ->description )
260+ ->oxymel ( $ this ->term_meta ( $ term ) )
259261 ->end ;
260262 }
261263 return $ oxymel ->to_string ();
@@ -276,4 +278,20 @@ protected function comment_meta( $comment ) {
276278 }
277279 return $ oxymel ;
278280 }
281+
282+ protected function term_meta ( $ term ) {
283+ global $ wpdb ;
284+ $ metas = $ wpdb ->get_results ( $ wpdb ->prepare ( "SELECT * FROM $ wpdb ->termmeta WHERE term_id = %d " , $ term ->term_id ) );
285+ if ( ! $ metas ) {
286+ return new Oxymel ();
287+ }
288+ $ oxymel = new WP_Export_Oxymel ();
289+ foreach ( $ metas as $ meta ) {
290+ $ oxymel ->tag ( 'wp:termmeta ' )->contains
291+ ->tag ( 'wp:meta_key ' )->contains ->cdata ( $ meta ->meta_key )->end
292+ ->tag ( 'wp:meta_value ' )->contains ->cdata ( $ meta ->meta_value )->end
293+ ->end ;
294+ }
295+ return $ oxymel ;
296+ }
279297}
You can’t perform that action at this time.
0 commit comments