WordPress at Your Fingertips
function is not described

WC_Product_CSV_Importer::parse_tags_field() public WC 1.0

Parse a tag field from a CSV.

{} It's a method of the class: WC_Product_CSV_Importer{}

No Hooks.

Return

Array.

Usage

$WC_Product_CSV_Importer = new WC_Product_CSV_Importer();
$WC_Product_CSV_Importer->parse_tags_field( $value );
$value(string) (required)
Field value.

Code of WC_Product_CSV_Importer::parse_tags_field() WC 5.6.0

public function parse_tags_field( $value ) {
	if ( empty( $value ) ) {
		return array();
	}

	$value = $this->unescape_data( $value );
	$names = $this->explode_values( $value );
	$tags  = array();

	foreach ( $names as $name ) {
		$term = get_term_by( 'name', $name, 'product_tag' );

		if ( ! $term || is_wp_error( $term ) ) {
			$term = (object) wp_insert_term( $name, 'product_tag' );
		}

		if ( ! is_wp_error( $term ) ) {
			$tags[] = $term->term_id;
		}
	}

	return $tags;
}