Last active
July 5, 2018 12:30
-
-
Save digitalchild/86e3b64cbad92dc16e15 to your computer and use it in GitHub Desktop.
File uploader
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
<?php | |
// Add this to your themes functions file | |
function wcv_file_uploader( ){ | |
$value = get_user_meta( get_current_user_id(), 'YOURMETAKEYHERE', true ); | |
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' => 'YOURMETAKEYHERE', | |
'save_button' => __('Add file', 'wcvendors-pro' ), | |
'window_title' => __('Select an Image', 'wcvendors-pro' ), | |
'value' => $value | |
) | |
); | |
} | |
// call this function in your template | |
wcv_file_uploader(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What if we want it required ? Normal attributes not work