admin管理员组文章数量:1415697
I want to run a javascript function when the add_attachment hook fires. The following code does not interfere with uploading an image.
add_action('add_attachment', function( $post_ID ) {
?>
<?php
});
When I add script tags and console.log("x"); I get an error message. The error message says "Bei dem Upload ist ein Fehler aufgetreten. Bitte versuche es später nochmal." See picture.
add_action('add_attachment', function( $post_ID ) {
?>
<script type="text/javascript">
console.log("x");
</script>
<?php
});
How can I avoid the error message and validate that my javascript code runs?
本文标签: Call javascript function when addattachment hook fires
版权声明:本文标题:Call javascript function when add_attachment hook fires 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745237607a2649129.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论