-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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