Skip to content

Commit 8a87925

Browse files
authored
Fix deprecated get_terms usage (#141)
1 parent f7d1fe2 commit 8a87925

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/WP_Export_Query.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,14 @@ public function custom_taxonomies_terms() {
121121
return [];
122122
}
123123
$custom_taxonomies = get_taxonomies( [ '_builtin' => false ] );
124-
// phpcs:ignore WordPress.WP.DeprecatedParameters.Get_termsParam2Found -- Deprecated, but we need to support older versions of WordPress.
125-
$custom_terms = (array) get_terms( $custom_taxonomies, [ 'get' => 'all' ] );
126-
$custom_terms = $this->process_orphaned_terms( $custom_terms );
127-
$custom_terms = self::topologically_sort_terms( $custom_terms );
124+
$custom_terms = (array) get_terms(
125+
[
126+
'taxonomy' => $custom_taxonomies,
127+
'get' => 'all',
128+
]
129+
);
130+
$custom_terms = $this->process_orphaned_terms( $custom_terms );
131+
$custom_terms = self::topologically_sort_terms( $custom_terms );
128132
return $custom_terms;
129133
}
130134

0 commit comments

Comments
 (0)