Skip to content

Instantly share code, notes, and snippets.

@bentasm1
Forked from digitalchild/functions.php
Last active September 3, 2016 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bentasm1/2bc3491d51d2d7c5689a to your computer and use it in GitHub Desktop.
Save bentasm1/2bc3491d51d2d7c5689a to your computer and use it in GitHub Desktop.
WC Vendors Pro - Add another file uploader to the add/edit product form
/* WC Vendors Pro - Add another file uploader to upload a file with the ID in a meta key */
function custom_wcv_file_uploader( ){
$value = get_user_meta( get_current_user_id(), 'wcv_custom_product_file1', true ); // Must match meta key used in line 8
WCVendors_Pro_Form_Helper::file_uploader( array(
'header_text' => __('File uploader', 'wcvendors-pro' ),
'add_text' => __('Add file', 'wcvendors-pro' ),
'remove_text' => __('Remove file', 'wcvendors-pro' ),
'image_meta_key' => 'wcv_custom_product_file1', // Must match meta key used in line 3
'save_button' => __('Add file', 'wcvendors-pro' ),
'window_title' => __('Select an Image', 'wcvendors-pro' ),
'value' => $value
)
);
}
// call this function in your product-edit.php template
<?php
custom_wcv_file_uploader();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment