Advertisement
Guest User

addMediaUploadTab.php

a guest
Apr 26th, 2012
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 20.08 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. function addMediaUploadTab($tabs) {
  5.     $newtab = array('mlc' => __('Media Categories', 'mlc'));
  6.     return array_merge($tabs, $newtab);
  7. }
  8. add_filter('media_upload_tabs', 'addMediaUploadTab');
  9.  
  10.  
  11. function MediaUploadTabClicked() {
  12. global $wpdb;
  13.  
  14.     if ( isset($_POST['insertshortcode']) ) {
  15.         $mlc =0;
  16.         if ( isset($_POST['selectedCategory']) ){
  17.             $mlc = (int) $_POST['selectedCategory'];
  18.         }
  19.         $html="[mediacategories categories=\"$mlc\"]";
  20.        
  21.         return media_send_to_editor($html);
  22.     }
  23.     else if ( isset($_POST['savesort']) ) {
  24.         if ( isset($_POST['selectedCategory']) && isset($_POST['newsortorder']) && isset($_POST['taxonomyID'])){
  25.             $mlc = (int) $_POST['selectedCategory'];
  26.             $newsortorder =  $_POST['newsortorder'];
  27.             $taxonomyID =  $_POST['taxonomyID'];
  28.             if($newsortorder!="")
  29.             {
  30.                 $ids = explode(",", $newsortorder);
  31.                 $i=1;
  32.                 foreach ($ids as $id)
  33.                 {
  34.                     //update term_taxonomy with sort
  35.                     $updatequery = "UPDATE $wpdb->term_relationships set term_order=$i where object_id=$id AND term_taxonomy_id=$taxonomyID;";
  36.                     $updateresult = $wpdb->query($updatequery);
  37.                     $i+=1;
  38.                 }
  39.             }
  40.         }
  41.     }
  42.     else if ( isset($_POST['insertselected']) ) {
  43.         $selected = $_POST['selected'];
  44.         $html="";
  45.         if( is_array($selected)) { 
  46.             foreach ( array_keys($selected) as $attachmentID ) {
  47.                 $image = $_POST['image'][$attachmentID];
  48.                
  49.                 $alttext = stripslashes( htmlspecialchars ($image['alttext'], ENT_QUOTES));
  50.                 $description = stripslashes (htmlspecialchars($image['description'], ENT_QUOTES));
  51.                
  52.                 $clean_description = preg_replace("/\n|\r\n|\r$/", " ", $description);
  53.                
  54.                
  55.                 if(contains($image['mimetype'],"image"))
  56.                 {
  57.                     $class='align-'.$image['align'].' size-'.$image['image-size'].' wp-image-'.$attachmentID;
  58.                     $imgurl = wp_get_attachment_image_src($attachmentID, $image['image-size']);
  59.                     $imgfullsizeurl = wp_get_attachment_image_src($attachmentID, "full");
  60.                     //$img = "<img src='$imgurl[0]' alt='$alttext' class='$class' />";
  61.                     //$html .= "<a href='$imgfullsizeurl[0]' title='$clean_description' target='_blank'>$img</a><br />";
  62.                     $img = '<img src="'.$imgurl[0].'" alt="'.$alttext.'" class="'.$class.'" />';
  63.                     $html .= '<a href="'.get_bloginfo( 'url' ).'/?attachment_id='.$attachmentID.'" title="'.$clean_description.'" target="_blank" rel="attachment wp-att-'.$attachmentID.'">'.$img.'</a>';
  64.                 }
  65.                 else
  66.                 {
  67.                     $fileurl=$image['url'];
  68.                     $title=$image['title'];
  69.                     $html .= "<a href='$fileurl' title='$clean_description' target='_blank'>$title</a><br />";
  70.                 }
  71.             }
  72.         }
  73.         return media_send_to_editor($html);
  74.     }
  75.     else if ( isset($_POST['send']) ) {
  76.         $keys = array_keys($_POST['send']);
  77.         $send_id = (int) array_shift($keys);
  78.         $image = $_POST['image'][$send_id];
  79.         $alttext = stripslashes( htmlspecialchars ($image['alttext'], ENT_QUOTES));
  80.         $description = stripslashes (htmlspecialchars($image['description'], ENT_QUOTES));
  81.        
  82.         $clean_description = preg_replace("/\n|\r\n|\r$/", " ", $description);
  83.         $class='align-'.$image['align'].' size-'.$image['image-size'].' wp-image-'.$send_id;
  84.        
  85.         if(contains($image['mimetype'],"image"))
  86.         {
  87.             $imgurl = wp_get_attachment_image_src($send_id, $image['image-size']);
  88.             $imgfullsizeurl = wp_get_attachment_image_src($send_id, "full");
  89.             $html = '<img src="'.$imgurl[0].'" alt="'.$alttext.'" class="'.$class.'" />';
  90.             $html = '<a href="'.get_bloginfo( 'url' ).'/?attachment_id='.$send_id.'" title="'.$clean_description.'" target="_blank" rel="attachment wp-att-'.$send_id.'">'.$html.'</a>';
  91.             // $html = '<a href="'.$imgfullsizeurl[0].'" title="'.$clean_description.'" target="_blank" rel="attachment wp-att-'.$send_id.'">'.$html.'</a>';
  92.         }
  93.         else
  94.         {
  95.             $fileurl=$image['url'];
  96.             $title=$image['title'];
  97.             $html = "<a href='$fileurl' title='$clean_description' target='_blank'>$title</a>";
  98.         }
  99.        
  100.        
  101.         // Return it to TinyMCE
  102.         return media_send_to_editor($html);
  103.     }
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.     return wp_iframe( 'media_tab_render');
  111. }
  112. add_action('media_upload_mlc', 'MediaUploadTabClicked');
  113.  
  114.    
  115.    
  116. function media_tab_render() {
  117.    
  118.     global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types, $mc_var;
  119.    
  120.     media_upload_header();
  121.    
  122.     $post_id    = intval($_REQUEST['post_id']);
  123.     $mlc    = 0;
  124.     $attachments = array();
  125.     $categories=array();
  126.     $currentsortorder="";
  127.     $form_action_url = site_url( "wp-admin/media-upload.php?type={$GLOBALS['type']}&tab=mlc&post_id=$post_id", 'admin');
  128.  
  129.    
  130.        
  131.     // Get number of images in gallery 
  132.     if ( isset($_REQUEST['selectedCategory']) ){
  133.         $mlc = (int) $_REQUEST['selectedCategory'];
  134.         $taxonomyID=$wpdb->get_var(("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy where term_id=$mlc"));
  135.        
  136.         $categories=$mc_var->get_category_hierarchical_list($mlc);
  137.        
  138.         $query =    "SELECT p.*, a.term_order FROM " . $wpdb->prefix . "posts p
  139.        inner join " . $wpdb->prefix . "term_relationships a on a.object_id = p.ID
  140.        inner join " . $wpdb->prefix . "term_taxonomy ttt on ttt.term_taxonomy_id = a.term_taxonomy_id
  141.        inner join " . $wpdb->prefix . "terms tt on ttt.term_id = tt.term_id
  142.        where ttt.taxonomy='".mc::$taxonomy."' && tt.term_id=$mlc order by a.term_order asc";
  143.         $attachments = $wpdb->get_results($query, 'ARRAY_A');
  144.            
  145.        
  146.     }
  147.    
  148.     // WP-Core code for Post-thumbnail
  149.     $calling_post_id = 0;
  150.     if ( isset( $_GET['post_id'] ) )
  151.         $calling_post_id = $_GET['post_id'];
  152.  
  153.         ?>
  154.    
  155. <form id="filter" action="" method="get">
  156. <input type="hidden" name="type" value="<?php echo esc_attr( $GLOBALS['type'] ); ?>" />
  157. <input type="hidden" name="tab" value="<?php echo esc_attr( $GLOBALS['tab'] ); ?>" />
  158. <input type="hidden" name="post_id" value="<?php echo (int) $post_id; ?>" />
  159. <div class="tablenav">
  160.    
  161.    
  162.     <div class="alignleft actions">
  163.         <select id="selectedCategory" name="selectedCategory" style="width:250px;">
  164.             <option value="0" <?php selected('0', $mlc); ?> ><?php esc_attr( _e('-- Select --',"mlc") ); ?></option>
  165.             <?php
  166.                 echo $mc_var->get_category_hierarchical_selectoptions($mlc);
  167.             ?>
  168.         </select>
  169.         <input type="submit" id="show-Category" value="<?php esc_attr( _e('Select &#187;','mlc') ); ?>" class="button-secondary" />
  170.     </div>
  171.     <br style="clear:both;" />
  172. </div>
  173. </form>
  174.  
  175. <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  176. <!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  177. <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> -->
  178.  
  179. <script type="text/javascript">
  180.     jQuery(document).ready(function() {
  181.         jQuery("#media-items").sortable({
  182.            stop: function(event, ui) {
  183.                 jQuery("#newsortorder").val("");
  184.                 var mediaItems = jQuery("#media-items div.mlcsortable:not('.ui-sortable-placeholder')");
  185.                 mediaItems.each(function(index) {
  186.                     var id = jQuery(this).attr("attachmentid");
  187.                     //alert(index + ': ' + id);
  188.                     var currentsortorder= jQuery("#newsortorder").val();
  189.                     jQuery("#newsortorder").val(currentsortorder+(currentsortorder!=""?",":"")+id);
  190.                 });
  191.            }
  192.         });
  193.     });
  194. </script>
  195. <script type="text/javascript">
  196. function WPSetAsThumbnail2(c,b){var a=jQuery("a#mlc-post-thumbnail-"+c);a.text(setPostThumbnailL10n.saving);jQuery.post(ajaxurl,{action:"set-post-thumbnail",post_id:post_id,thumbnail_id:c,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(e){var d=window.dialogArguments||opener||parent||top;a.text(setPostThumbnailL10n.setThumbnail);if(e=="0"){alert(setPostThumbnailL10n.error)}else{jQuery("a.mlc-post-thumbnail").show();a.text(setPostThumbnailL10n.done);a.fadeOut(2000);d.WPSetThumbnailID(c);d.WPSetThumbnailHTML(e)}})};
  197. </script>
  198. <style type="text/css">
  199.     .filename {
  200.     left: 47px;
  201.     position: absolute;
  202.     width: 480px;
  203. }
  204. </style>
  205. <form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="media-upload-form validate" id="library-form" >
  206.  
  207.     <?php wp_nonce_field('mlc-media-form'); ?>
  208.  
  209. <script type="text/javascript">
  210. //<![CDATA[
  211. jQuery(function($){
  212.     var preloaded = $(".media-item.preloaded");
  213.     if ( preloaded.length > 0 ) {
  214.         preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
  215.     }
  216.     updateMediaForm();
  217. });
  218. //]]>
  219. </script>
  220.     <input type="hidden" name="post_id" id="post_id" value="0" />
  221.     <div id="media-items">
  222.     <?php
  223.    
  224.    
  225.     if( is_array($attachments)) {  
  226.         foreach ( $attachments as $attachment ) {
  227.            
  228.             $currentsortorder.=($currentsortorder!=""?",":"").$attachment["ID"];       
  229.        
  230.             $mime = strtolower($attachment['post_mime_type']);
  231.            
  232.             if(contains($mime, "image"))
  233.             { //IMAGE
  234.                 $thumb="";
  235.                 $fileurl="";
  236.                
  237.                 $thumb = wp_get_attachment_thumb_url( $attachment["ID"] );
  238.                 $fileurl = $attachment["guid"];
  239.                
  240.                 ?>
  241.                 <div id='media-item-<?php echo $attachment["ID"] ?>' attachmentid="<?php echo $attachment["ID"] ?>" class='media-item preloaded mlcsortable'>
  242.                 <input id="type-of-<?php echo $attachment["ID"] ?>" value="image" type="hidden">
  243.                 <input name="image[<?php echo $attachment["ID"] ?>][mimetype]" id="image-mimetype-<?php echo $attachment["ID"] ?>"  value="<?php echo $mime ?>" type="hidden" />
  244.                 <div class='filename'></div>
  245.                   <a class='toggle describe-toggle-on' href='#'><?php esc_attr( _e('Show', "mlc") ); ?></a>
  246.                   <a class='toggle describe-toggle-off' href='#'><?php esc_attr( _e('Hide', "mlc") );?></a>
  247.                   <div class='filename new'><input class="mlccheckbox" type="checkbox" name="selected[<?php echo $attachment["ID"] ?>]" id="mlc_<?php echo $attachment["ID"] ?>" style="margin:5px;" /><?php echo stripslashes( wp_html_excerpt($attachment["post_title"],60) ); ?></div>
  248.                  
  249.                   <table class='slidetoggle describe startclosed'><tbody>
  250.                       <tr>
  251.                         <td rowspan='4' style="padding:0px;" align="center"><img class='thumbnail' alt='<?php echo esc_attr( $attachment["post_excerpt"] ); ?>' src='<?php echo esc_attr( $thumb ); ?>'/></td>
  252.                         <td><?php esc_attr( _e('Media ID:', "mlc") ); ?><?php echo $attachment["ID"] ?></td>
  253.                       </tr>
  254.                       <tr><td><?php echo esc_attr( $fileurl ); ?></td></tr>
  255.                       <tr><td><?php echo esc_attr( stripslashes($attachment["post_excerpt"]) ); ?></td></tr>
  256.                       <tr><td>&nbsp;</td></tr>
  257.                       <tr>
  258.                           <th valign="top" class="label" scope="row"><label for="image[<?php echo $attachment["ID"] ?>][alttext]"><span class="alignleft">Alternate Text</span><br class="clear"></label></th>
  259.                           <td class="field"><input id="image[<?php echo $attachment["ID"] ?>][alttext]" name="image[<?php echo $attachment["ID"] ?>][alttext]" value="<?php esc_attr_e( stripslashes($attachment["post_excerpt"]) ); ?>" type="text"/></td>
  260.                       </tr>
  261.                       <tr class="post_content">
  262.                             <th valign="top" class="label" scope="row">
  263.                             <label for="image[<?php echo $attachment["ID"] ?>][description]"><span class="alignleft">Description</span><br class="clear"></label>
  264.                             </th>
  265.                             <td class="field"><textarea name="image[<?php echo $attachment["ID"] ?>][description]" id="image[<?php echo $attachment["ID"] ?>][description]"><?php esc_attr_e( stripslashes($attachment["post_content"]) ); ?></textarea></td>
  266.                       </tr>
  267.                         <tr class="align">
  268.                             <th valign="top" class="label" scope="row"><label for="image[<?php echo $attachment["ID"] ?>][align]"><span class="alignleft">Alignment</span><br class="clear"></label></th>
  269.                             <td class="field">
  270.                                 <input name="image[<?php echo $attachment["ID"] ?>][align]" id="image-align-none-<?php echo $attachment["ID"] ?>" checked="checked" value="none" type="radio" />
  271.                                 <label for="image-align-none-<?php echo $attachment["ID"] ?>" class="align image-align-none-label"><?php esc_attr_e("None") ;?></label>
  272.                                 <input name="image[<?php echo $attachment["ID"] ?>][align]" id="image-align-left-<?php echo $attachment["ID"] ?>" value="left" type="radio" />
  273.                                 <label for="image-align-left-<?php echo $attachment["ID"] ?>" class="align image-align-left-label"><?php esc_attr_e("Left") ;?></label>
  274.                                 <input name="image[<?php echo $attachment["ID"] ?>][align]" id="image-align-center-<?php echo $attachment["ID"] ?>" value="center" type="radio" />
  275.                                 <label for="image-align-center-<?php echo $attachment["ID"] ?>" class="align image-align-center-label"><?php esc_attr_e("Center") ;?></label>
  276.                                 <input name="image[<?php echo $attachment["ID"] ?>][align]" id="image-align-right-<?php echo $attachment["ID"] ?>" value="right" type="radio" />
  277.                                 <label for="image-align-right-<?php echo $attachment["ID"] ?>" class="align image-align-right-label"><?php esc_attr_e("Right") ;?></label>
  278.                             </td>
  279.                         </tr>
  280.                         <tr class="image-size">
  281.                             <th valign="top" class="label" scope="row"><label for="image[<?php echo $attachment["ID"] ?>][image-size]">
  282.                                 <span class="alignleft">Size</span><br class="clear"></label>
  283.                             </th>
  284.                             <td class="field">
  285.                                 <div class="image-size-item">
  286.                                     <input type="radio" checked="checked" value="thumbnail" id="image-size-thumbnail-<?php echo $attachment["ID"] ?>" name="image[<?php echo $attachment["ID"] ?>][image-size]" >
  287.                                     <label for="image-size-thumbnail-<?php echo $attachment["ID"] ?>">Thumbnail</label>
  288.                                 </div>
  289.                                 <div class="image-size-item">
  290.                                     <input type="radio" value="medium" id="image-size-medium-<?php echo $attachment["ID"] ?>" name="image[<?php echo $attachment["ID"] ?>][image-size]" >
  291.                                     <label for="image-size-medium-<?php echo $attachment["ID"] ?>">Medium</label>
  292.                                 </div>
  293.                                 <div class="image-size-item">
  294.                                     <input type="radio" value="large" id="image-size-large-<?php echo $attachment["ID"] ?>" name="image[<?php echo $attachment["ID"] ?>][image-size]" >
  295.                                     <label for="image-size-large-<?php echo $attachment["ID"] ?>">Large</label>
  296.                                 </div>
  297.                                 <div class="image-size-item">
  298.                                     <input type="radio" value="full" id="image-size-full-<?php echo $attachment["ID"] ?>" name="image[<?php echo $attachment["ID"] ?>][image-size]">
  299.                                     <label for="image-size-full-<?php echo $attachment["ID"] ?>">Full Size</label>
  300.                                 </div>
  301.                             </td>
  302.                         </tr>
  303.                         <tr class="submit">
  304.                             <td>
  305.                                 <input type="hidden"  name="image[<?php echo $attachment["ID"] ?>][thumb]" value="<?php echo $thumb ?>" />
  306.                                 <input type="hidden"  name="image[<?php echo $attachment["ID"] ?>][url]" value="<?php echo $fileurl ?>" />
  307.                             </td>
  308.                             <td class="savesend">
  309.                                 <?php
  310.                                 if ( $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) )//onclick='NGGSetAsThumbnail(\"$attachment["ID"]\");
  311.                                     $mon_attachement_id = $attachment["ID"];
  312.                                    
  313.                                     $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" );
  314.                                     echo "<a class='mlc-post-thumbnail' id='mlc-post-thumbnail-" . $attachment["ID"] . "' href='#' onclick='WPSetAsThumbnail2(\"".$attachment["ID"]."\", \"$ajax_nonce\");return false;'>" . esc_html__( 'Use as featured image' ) . "</a>";
  315.                                 ?>
  316.                                 <input name="send[<?php echo $attachment["ID"] ?>]" id="send[<?php echo $attachment["ID"] ?>]" class="button" value="<?php esc_html_e( 'Insert into Post' ); ?>" type="submit">
  317.                                
  318.                             </td>
  319.                        </tr>
  320.                   </tbody></table>
  321.                 </div>
  322.             <?php
  323.             }
  324.             else
  325.             {
  326.                 $thumb="/wp-includes/images/crystal/document.png"; 
  327.                     if(contains($mime, "audio"))
  328.                     {
  329.                         $thumb="/wp-includes/images/crystal/audio.png";
  330.                     }
  331.                     else if(contains($mime, "video"))
  332.                     {
  333.                         $thumb="/wp-includes/images/crystal/video.png";
  334.                     }
  335.                 $fileurl = $attachment["guid"];
  336.                
  337.                 ?>
  338.                
  339.                 <div id='media-item-<?php echo $attachment["ID"] ?>' attachmentid="<?php echo $attachment["ID"] ?>" class='media-item preloaded mlcsortable' >
  340.                   <input id="type-of-<?php echo $attachment["ID"] ?>" value="image" type="hidden">
  341.                   <input name="image[<?php echo $attachment["ID"] ?>][mimetype]" id="image-mimetype-<?php echo $attachment["ID"] ?>"  value="<?php echo $mime ?>" type="hidden" />
  342.                   <div class='filename'></div>
  343.                   <a class='toggle describe-toggle-on' href='#'><?php esc_attr( _e('Show', "mlc") ); ?></a>
  344.                   <a class='toggle describe-toggle-off' href='#'><?php esc_attr( _e('Hide', "mlc") );?></a>
  345.                   <div class='filename new'><input class="mlccheckbox" type="checkbox" name="selected[<?php echo $attachment["ID"] ?>]" id="mlc_<?php echo $attachment["ID"] ?>" style="margin:5px;" /><?php echo stripslashes( wp_html_excerpt($attachment["post_title"],60) ); ?></div>
  346.                   <table class='slidetoggle describe startclosed'><tbody>
  347.                       <tr>
  348.                         <td rowspan='4' style="padding:0px;" align="center"><img class='thumbnail' alt='<?php echo esc_attr( $attachment["post_excerpt"] ); ?>' src='<?php echo esc_attr( $thumb ); ?>'/></td>
  349.                         <td><?php esc_attr( _e('Media ID:', "mlc") ); ?><?php echo $attachment["ID"] ?></td>
  350.                       </tr>
  351.                       <tr><td><?php echo $attachment["post_title"]; ?></td></tr>
  352.                       <tr><td><?php echo esc_attr( $fileurl ); ?></td></tr>
  353.                       <tr><td><?php echo esc_attr( stripslashes($attachment["post_excerpt"]) ); ?></td></tr>
  354.                       <tr><td>&nbsp;</td></tr>
  355.                       <tr>
  356.                           <th valign="top" class="label" scope="row"><label for="image[<?php echo $attachment["ID"] ?>][alttext]"><span class="alignleft">Alternate Text</span><br class="clear"></label></th>
  357.                           <td class="field"><input id="image[<?php echo $attachment["ID"] ?>][alttext]" name="image[<?php echo $attachment["ID"] ?>][alttext]" value="<?php esc_attr_e( stripslashes($attachment["post_excerpt"]) ); ?>" type="text"/></td>
  358.                       </tr>
  359.                       <tr class="post_content">
  360.                             <th valign="top" class="label" scope="row">
  361.                             <label for="image[<?php echo $attachment["ID"] ?>][description]"><span class="alignleft">Description</span><br class="clear"></label>
  362.                             </th>
  363.                             <td class="field"><textarea name="image[<?php echo $attachment["ID"] ?>][description]" id="image[<?php echo $attachment["ID"] ?>][description]"><?php esc_attr_e( stripslashes($attachment["post_content"]) ); ?></textarea></td>
  364.                       </tr>
  365.                        
  366.                        <tr class="submit">
  367.                             <td>
  368.                                 <input type="hidden"  name="image[<?php echo $attachment["ID"] ?>][title]" value="<?php echo $attachment["post_title"] ?>" />
  369.                                 <input type="hidden"  name="image[<?php echo $attachment["ID"] ?>][thumb]" value="<?php echo $thumb ?>" />
  370.                                 <input type="hidden"  name="image[<?php echo $attachment["ID"] ?>][url]" value="<?php echo $fileurl ?>" />
  371.                             </td>
  372.                             <td class="savesend">
  373.                                 <?php
  374.                                 if ( $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) )//onclick='NGGSetAsThumbnail(\"$attachment["ID"]\");
  375.                                     $mon_attachement_id = $attachment["ID"];
  376.                                    
  377.                                     $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" );
  378.                                     echo "<a class='mlc-post-thumbnail' id='mlc-post-thumbnail-" . $attachment["ID"] . "' href='#' onclick='WPSetAsThumbnail2(\"".$attachment["ID"]."\", \"$ajax_nonce\");return false;'>" . esc_html__( 'Use as featured image' ) . "</a>";
  379.                                 ?>
  380.                                 <input name="send[<?php echo $attachment["ID"] ?>]" id="send[<?php echo $attachment["ID"] ?>]" class="button" value="<?php esc_html_e( 'Insert into Post' ); ?>" type="submit">
  381.                                
  382.                                
  383.                             </td>
  384.                        </tr>
  385.                   </tbody></table>
  386.                 </div>
  387.             <?php
  388.             }
  389.         }
  390.     }
  391.     ?>
  392.     </div>
  393.     <p class="ml-submit">
  394.         <input type="submit" class="button savebutton" name="insertselected" value="<?php esc_attr( _e('Insert Selected','mlc') ); ?>" />
  395.         <input type="submit" class="button savebutton" name="savesort" value="<?php esc_attr( _e('Save Sort Order','mlc') ); ?>" />
  396.         <input type="submit" class="button savebutton" name="insertshortcode" value="<?php esc_attr( _e('Insert Category Shortcode','mlc') ); ?>" />
  397.     </p>
  398.     <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
  399.     <input type="hidden" name="selectedCategory" id="selectedCategory" value="<?php echo (int) $mlc; ?>" />
  400.     <input type="hidden" name="newsortorder" id="newsortorder" value="<?php echo $currentsortorder; ?>" />
  401.     <input type="hidden" name="taxonomyID" id="taxonomyID" value="<?php echo $taxonomyID; ?>" />
  402. </form>
  403. <?php
  404.    
  405. }
  406.  
  407.  
  408.  
  409.    
  410.    
  411.  
  412. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement