woo_um_get_allowed_filetypes

Get allowed or disallowed filetypes and corresponding language strings.

Description

woo_um_get_allowed_filetypes( $product_id ); 

Parameters (1)

0. $product_id
The product id.

Usage

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

Defined (1)

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

/inc/umf-funct.php  
  1. function woo_um_get_allowed_filetypes($product_id) { 
  2. if(get_post_meta($product_id, '_woo_umf_filetypes', true )=="") { 
  3. $filetypes = get_option( 'woocommerce_umf_allowed_file_types' ); 
  4. } else { 
  5. $filetypes = get_post_meta( $product_id, '_woo_umf_filetypes', true ); 
  6. return __('Allowed filetypes:', 'woocommerce-umf').' '.$filetypes;