【问题标题】:Wordpress custom save button in post type says: are you sure you leave this page?帖子类型中的 Wordpress 自定义保存按钮说:您确定要离开此页面吗?
【发布时间】:2018-03-28 07:52:42
【问题描述】:

我创建了一个带有元框的自定义帖子类型,最后我放了一个按钮来保存更改

<?php submit_button( 'Controlla ora', 'primary', 'controlla_button' );?>

如果在我按下按钮时进行更改,则会出现一个弹出窗口:“你确定要离开这个页面吗?”

有没有办法像“保存草稿”一样使用这个按钮?我的意思是没有弹出窗口?

谢谢-

【问题讨论】:

    标签: wordpress custom-post-type submit-button


    【解决方案1】:

    已解决:

    <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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-02
      • 2016-06-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多