Last active
August 29, 2015 13:57
-
-
Save robspangler/9758112 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('media_buttons','add_sc_select',11); | |
function add_sc_select(){ | |
echo ' <select id="sc_select"> | |
<option>Shortcode</option> | |
<option value="[html][/html]">[html]</option> | |
<option value="[css][/css]">[css]</option> | |
<option value="[javascript][/javascript]">[javascript]</option> | |
</select>'; | |
} | |
add_action('admin_head', 'button_js'); | |
function button_js() { | |
echo '<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
jQuery(document).ready(function(){ | |
$("#sc_select").change(function() {$("#content").val($("#content").val()+$("#sc_select :selected").val());}) | |
}); | |
</script>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment