Пример #1
0
 public static function attachment_fields_to_edit($form_fields, $post)
 {
     $image_args = array("post_type" => "attachment", "numberposts" => 50, "post_status" => null, "post_mime_type" => "image", "post_parent" => null);
     $image_attachments = get_posts($image_args);
     $mime_type = substr($post->post_mime_type, 0, 5);
     if ('video' == $mime_type || 'audio' == $mime_type) {
         $poster_html = JWP6_Media::thumb_select_html($post->ID, $image_attachments);
         if (!isset($_REQUEST["post_id"])) {
             $poster_html .= JWP6_Media::insert_javascript_for_attachment_fields($post);
         }
         $form_fields[LONGTAIL_KEY . "thumbnail"] = array("label" => "Poster image", "input" => "html", "html" => $poster_html);
         if (isset($_REQUEST["post_id"])) {
             $form_fields[JWP6 . "insert_with_player"] = array("label" => "Embed with", "input" => "html", "html" => JWP6_Media::insert_player_html($post));
         }
     }
     return $form_fields;
 }