Support

Account

Home Forums ACF PRO WooCommerce and ACF upload files in Product Attributes

Helping

WooCommerce and ACF upload files in Product Attributes

  • Hi to all, I have added in a Product Attributes Class the upload files field.

    What code I should to be used to have this array, and what is the correct ACF upload files setup?

    $files = array(
    		'product-attribute-1' => $_SERVER["DOCUMENT_ROOT"].'/wp-content/uploads/sites/ID/aaaa/mm/file-name-1',
    		'product-attribute-2' => $_SERVER["DOCUMENT_ROOT"].'/wp-content/uploads/sites/ID/aaaa/mm/file-name-2',
    		'product-attribute-3' => $_SERVER["DOCUMENT_ROOT"].'/wp-content/uploads/sites/ID/aaaa/mm/file-name-3',
    ...
    		'product-attribute-last' => $_SERVER["DOCUMENT_ROOT"].'/wp-content/uploads/sites/ID/aaaa/mm/file-name-last',
    
    	);
  • Hi @funkman733

    I am not confident that I have understood your question but if you are looking to get the server path for certain field using the File field, you can use a native WP function such as get_attached_file()

    You can then echo the values using the the_field(..) function.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘WooCommerce and ACF upload files in Product Attributes’ is closed to new replies.