Пример #1
0
 public static function wp_media_upload_button($data = array())
 {
     $default = array('name' => 'front_media_uploader', 'class' => 'listing-images-uploads', 'value' => __('Upload', 'framework'), 'thumbnail_container' => 'photoList');
     $data = $default + $data;
     $data_button = '';
     if (is_user_logged_in()) {
         if (Browser::isHTML5() && self::check_file_input_method() == 0) {
             $data_button .= '<input class="listing-images-uploads" type="file" name="images[]" id="photoimg" multiple accept="image/*" />';
         } else {
             $data_button .= '<div class="' . $data['class'] . '">';
             $data_button .= '<input id="cbafu_button" data-container="' . $data['thumbnail_container'] . '" ';
             $data_button .= ' class="' . $data['class'] . '"';
             $data_button .= ' name="' . $data['name'] . '" type="button" value="' . $data['value'] . '" /></div>';
         }
     } else {
         $data_button .= '<input type="file" name="images[]" disabled="disabled" multiple accept="image/*" />';
     }
     echo $data_button;
 }
Пример #2
0
     $step = 2;
 } elseif ($steps == "listing-add-form-three") {
     $step = 3;
 } elseif ($steps == "listing-add-form-four") {
     $step = 4;
 } elseif ($steps == "listing-add-form-five") {
     $step = 5;
 }
 $already_step = get_post_meta($pid, 'imic_plugin_ads_steps', true);
 if ($already_step < $step) {
     //update_post_meta($pid,'imic_plugin_ads_steps',$step);
 }
 $i = 1;
 ////////// check input method and browser //////////////
 $files = array();
 if (Browser::isHTML5() && FRONT_MEDIA_ALLOW::check_file_input_method() == 0) {
     $files = isset($_FILES['images']) ? $_FILES['images'] : '';
 } else {
     $list_photo = $_REQUEST['listing_photos'];
     foreach ($list_photo as $photo) {
         if (!in_array($photo, $attached_images)) {
             if ($i == 1) {
                 update_post_meta($pid, '_thumbnail_id', $photo);
             }
             add_post_meta($pid, 'imic_plugin_vehicle_images', $photo, false);
         }
         $i++;
     }
 }
 /////////////////////////
 if (!empty($files)) {