Last active
October 6, 2016 06:39
-
-
Save fbentele/7b4f383a7cda7530070b84ba67da29be 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
<?php | |
add_action('media_buttons', 'my_super_function'); | |
function my_super_function(){ | |
?> | |
<a href="#" id="aid-nf-insert-submission" class="button"><span class="nf-insert-form dashicons dashicons-feedback"></span> Shortcode einfügen</a> | |
<script> | |
jQuery(function($) { | |
$(document).ready(function(){ | |
$("#aid-nf-insert-submission").click(function(){ | |
// my code | |
}); | |
$(document).on('click', '#aid-nf-insert-form', function(){ | |
// my code | |
wp.media.editor.insert('my text'); | |
}); | |
}); | |
}); | |
</script> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment