Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function optionsframework_media_uploader_function($id,$std,$mod){
- $data = of_get_options();
- $smof_data = of_get_options();
- $uploader = '';
- $upload = "";
- if (isset($smof_data[$id]))
- $upload = $smof_data[$id];
- $hide = '';
- if ($mod == "min") {$hide ='hide';}
- if ( $upload != "") { $val = $upload; } else {$val = $std;}
- $uploader .= '<input class="'.$hide.' upload of-input" name="'. $id .'" id="'. $id .'_upload" value="'. $val .'" />';
- //Upload controls DIV
- $uploader .= '<div class="upload_button_div">';
- //If the user has WP3.5+ show upload/remove button
- if ( function_exists( 'wp_enqueue_media' ) ) {
- $uploader .= '<span class="button media_upload_button" id="'.$id.'">Upload</span>';
- if(!empty($upload)) {$hide = '';} else { $hide = 'hide';}
- $uploader .= '<span class="button remove-image '. $hide.'" id="reset_'. $id .'" title="' . $id . '">Remove</span>';
- }
- else
- {
- $output .= '<p class="upload-notice"><i>Upgrade your version of WordPress for full media support.</i></p>';
- }
- $uploader .='</div>' . "\n";
- //Preview
- $uploader .= '<div class="screenshot">';
- if(!empty($upload)){
- $uploader .= '<a class="of-uploaded-image" href="'. $upload . '">';
- $uploader .= '<img class="of-option-image" id="image_'.$id.'" src="'.$upload.'" alt="" />';
- $uploader .= '</a>';
- }
- $uploader .= '</div>';
- $uploader .= '<div class="clear"></div>' . "\n";
- return $uploader;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement