wooccm_pro_csv_export_modify_column_headers

The WooCommerce Checkout Manager wooccm pro csv export modify column headers function.

Description

wooccm_pro_csv_export_modify_column_headers( $column_headers ); 

Parameters (1)

0. $column_headers
The column headers.

Usage

  1. if ( !function_exists( 'wooccm_pro_csv_export_modify_column_headers' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-checkout-manager/includes/classes/main.php'; 
  3.  
  4. // The column headers. 
  5. $column_headers = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wooccm_pro_csv_export_modify_column_headers($column_headers); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/classes/main.php  
  1. function wooccm_pro_csv_export_modify_column_headers( $column_headers ) {  
  2.  
  3. $new_headers = array(); 
  4. $shipping = array( 'country', 'first_name', 'last_name', 'company', 'address_1', 'address_2', 'city', 'state', 'postcode' ); 
  5. $billing = array( 'country', 'first_name', 'last_name', 'company', 'address_1', 'address_2', 'city', 'state', 'postcode', 'email', 'phone' ); 
  6.  
  7. $names = array( 'billing', 'shipping' ); 
  8. $inc = 3; 
  9. foreach( $names as $name ) { 
  10. $array = ($name == 'billing') ? $billing : $shipping; 
  11. $options = get_option( 'wccs_settings'.$inc.'' ); 
  12. foreach ( $options[''.$name.'_buttons'] as $btn ) : 
  13. if ( !in_array( $btn['cow'], $array ) ) {  
  14. $new_headers['_'.$name.'_'.$btn['cow'].''] = ''.wpml_string_wccm_pro($btn['label']).''; 
  15. endforeach; 
  16. $inc--; 
  17.  
  18.  
  19. $options = get_option( 'wccs_settings' ); 
  20. foreach ( $options['buttons'] as $btn ) : 
  21. $new_headers[''.$btn['cow'].''] = ''.wpml_string_wccm_pro($btn['label']).''; 
  22. endforeach; 
  23.  
  24. return array_merge( $column_headers, $new_headers );