check_for_files

Functie controleert of bestanden zijn geupload of niet.

Description

check_for_files( $order_id ); 

Parameters (1)

0. $order_id
The order id.

Usage

  1. if ( !function_exists( 'check_for_files' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-upload-my-file/inc/umf-funct.php'; 
  3.  
  4. // The order id. 
  5. $order_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = check_for_files($order_id); 
  9.  

Defined (1)

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

/inc/umf-funct.php  
  1. function check_for_files( $order_id ) { 
  2. $upload=false; 
  3. $order = new WC_Order( $order_id ); 
  4. if( (( is_array( get_option( 'woocommerce_umf_status' ) ) && in_array( $order->status, get_option( 'woocommerce_umf_status' ) ) ) ) || $order->status == get_option( 'woocommerce_umf_status' ) ) { 
  5. if(get_max_upload_count( $order ) >0 ) { 
  6. for ($i = 1; $i <= get_max_upload_count($order); $i++) { 
  7. $name = get_post_meta( $order_id, '_woo_umf_uploaded_file_name_' . $i, true ); 
  8. if( empty( $name ) ) {$upload = true;} 
  9. if($upload==true) {return 'upload';} else { return 'done'; } 
  10. } else { return 'blank';}