In WordPress editor we can also add our own link to perform different actions . I.e if you want to insert any shortcode or text from a drop-down list or any kind of text . It is simply to do with just a few lines of code . You just need to call media_buttons_context hook in your function.php or in your plugin . in this way

add_action('media_buttons_context', 'add_my_custom_button');

so we need to create a function add_my_custom_button which will initialize your code . here is the simple example

function add_my_custom_button($context) {
  
  //path to my icon
  $img = 'http://localhost/wp-content/uploads/Code-Optimization-3.png';
  
  //the id of the container I want to show in the popup
  $container_id = 'popup_container';
  
  //our popup's title
  $title = 'Insert php code';

  //append the icon
  $context .= "<a class='thickbox' title='{$title}'
    href='#TB_inline?width=640&inlineId={$container_id}'>
    <img src='{$img}' /></a>";
  
  return $context;
}

To handle a click event we need to insert some data to insert into editor .

add_action('init', 'add_inline_popup_content');

so here is the function add_inline_popup_content which will display the popup so that you can insert your stuff from here . window.send_to_editor(code) is the function to insert text into editor at the cursor point .

function add_inline_popup_content() {
?>
<script type="text/javascript">
   function addCode(){
      var code = '<pre lang="'+jQuery("#lang").val()+'" line="1">'+jQuery("#code").val()+'</pre>';
      if(code == ""){
         alert("<?php _e("Please select a form", "piereg") ?>");
                return;
      }
		window.send_to_editor(code);
      }
</script>
<div id="popup_container" style="display:none;">
    <select name="type" id="lang">
        <option value="java">Java</option>
        <option value="php">php</option>
    </select>
    <textarea style="min-height: 200px;width: 100%" name="code" id="code" ></textarea>
    <button type="submit" name="code_button" onclick="addCode();" id="code_bttn">Insert</button>
</div>
<?php } ?>

it is just an example how we can customize the wordpress editor according to our need . I have taken addCode inside the php function . If you are creating a plugin then you can define in a js file .

http://codingbin.com/wp-content/uploads/2015/12/Add-New-Post-‹-my-first-blog-—-WordPress.pnghttp://codingbin.com/wp-content/uploads/2015/12/Add-New-Post-‹-my-first-blog-—-WordPress-150x150.pngdevidcmsphpWordPresscustom button,wordpress editorIn WordPress editor we can also add our own link to perform different actions . I.e if you want to insert any shortcode or text from a drop-down list or any kind of text . It is simply to do with just a few lines of code . You...coding, php, wordpress, yii, cakephp, and  jquery

Are you want to get implementation help, or modify or extend the functionality of this script? Submit paid service request