我创建了一个带元框的自定义帖子类型,最后我点了一个保存更改的按钮
<?php submit_button( 'Controlla ora', 'primary', 'controlla_button' );?>
如果在按下按钮时进行更改,则会出现一个弹出窗口:“您确定要离开此页吗?”
有没有办法像“保存草稿”一样使用此按钮?我的意思是没有弹出窗口?
谢谢 -
答案 0 :(得分:0)
解决:
<input type="button" id="controlla_button" class="button button-primary" onclick="change_s()" value="Controlla ora" >
<script type="text/javascript">
function change_s(){
document.getElementById("publish").click();
}
</script>