Automattic\WooCommerce\Admin\Features\Blueprint\Exporters
ExportWCSettingsShipping::get_terms
Retrieve term data based on provided classes.
Method of the class: ExportWCSettingsShipping{}
No Hooks.
Returns
Array. Retrieved term data.
Usage
// protected - for code of main (parent) or child class $result = $this->get_terms( $classes ): array;
- $classes(array) (required)
- List of classes with term IDs.
ExportWCSettingsShipping::get_terms() ExportWCSettingsShipping::get terms code WC 10.8.1
protected function get_terms( array $classes ): array {
global $wpdb;
$term_ids = array_map( fn( $term ) => (int) $term['term_id'], $classes );
$term_ids = implode( ', ', $term_ids );
return ! empty( $term_ids ) ? $wpdb->get_results(
$wpdb->prepare(
"SELECT * FROM {$wpdb->prefix}terms WHERE term_id IN (%s)",
$term_ids
),
ARRAY_A
) : array();
}