Automattic\WooCommerce\Admin\Features\Blueprint\Exporters
ExportWCSettingsShipping::get_steps_for_classes_and_terms
Retrieve shipping classes and related terms.
Метод класса: ExportWCSettingsShipping{}
Хуков нет.
Возвращает
array. Steps for shipping classes and terms.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_steps_for_classes_and_terms(): array;
Код ExportWCSettingsShipping::get_steps_for_classes_and_terms() ExportWCSettingsShipping::get steps for classes and terms WC 11.1.2
protected function get_steps_for_classes_and_terms(): array {
global $wpdb;
$classes = $wpdb->get_results(
"SELECT * FROM {$wpdb->prefix}term_taxonomy WHERE taxonomy = 'product_shipping_class'",
ARRAY_A
);
$classes_steps = array_map(
fn( $class_row ) => RunSql::from_table_row( $class_row, 'term_taxonomy' ),
$classes
);
$terms = array_map(
fn( $term ) => RunSql::from_table_row( $term, 'terms' ),
$this->get_terms( $classes )
);
return array_merge( $classes_steps, $terms );
}