Don't like ads? PRO users don't see any ads ;-)
Guest

addMediaUploadTab.php

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