WC_CSV_Exporter::is_column_exporting()publicWC 3.1.0

See if a column is to be exported or not.

Method of the class: WC_CSV_Exporter{}

No Hooks.

Return

true|false.

Usage

$WC_CSV_Exporter = new WC_CSV_Exporter();
$WC_CSV_Exporter->is_column_exporting( $column_id );
$column_id(string) (required)
ID of the column being exported.

Changelog

Since 3.1.0 Introduced.

WC_CSV_Exporter::is_column_exporting() code WC 9.4.2

public function is_column_exporting( $column_id ) {
	$column_id         = strstr( $column_id, ':' ) ? current( explode( ':', $column_id ) ) : $column_id;
	$columns_to_export = $this->get_columns_to_export();

	if ( empty( $columns_to_export ) ) {
		return true;
	}

	if ( in_array( $column_id, $columns_to_export, true ) || 'meta' === $column_id ) {
		return true;
	}

	return false;
}