链接到wordpress中的自定义插件上的另一个页面

时间:2016-10-09 03:59:01

标签: php wordpress

我想通过以下添加新链接调用insert_alert.php。请帮助添加代码或执行此操作或挂钩。

demo1.php

<h3>LIST OF ALERTS
  <a href="<?php echo admin_url('admin.php?page=insert_alert_action'); ?>"
  class="btn btn-primary btn-xs" role="button">Add New</a></h3>

insert_alert.php PSEUDOCODE

function alert_options() {
  <div class="wrap">
  <h2>Alert</h2>
  <form method="post" action="<?php echo get_admin_url()."admin-post.php"; ?>">       
    <p><strong>Alert Title:</strong><br />
      <input type="text" name="title" size="20" required/>        
    </p>
    <p><strong>Alert Content:</strong><br />
      <textarea name="content" required></textarea>
    </p>
    <input type="hidden" name="action" value="submit-form" />        
    <p><input type="submit" name="Submit" value="Save Alert" /></p>
  </form>
  </div>
}

enter image description here

0 个答案:

没有答案