コード例 #1
0
function hookpress_ajax_set_enabled()
{
    $id = $_POST['id'];
    $enabled = $_POST['enabled'];
    // update the webhook
    $webhooks = get_option('hookpress_webhooks');
    $webhooks[$id]['enabled'] = $enabled == 'true' ? true : false;
    update_option('hookpress_webhooks', $webhooks);
    header("Content-Type: text/html; charset=UTF-8");
    echo hookpress_print_webhook($id);
    exit;
}
コード例 #2
0
	<table id='webhooks'>
	  <thead><tr><th colspan='3'><?php 
_e("hook", "hookpress");
?>
</th><th><?php 
_e("URL", "hookpress");
?>
</th><th><?php 
_e("fields", "hookpress");
?>
</th></tr></thead>
  	<tbody>
  	<?php 
foreach (get_option('hookpress_webhooks') as $id => $desc) {
    if (count($desc)) {
        echo hookpress_print_webhook($id);
    }
}
?>
  	</tbody>
	</table>

  <input class="thickbox button" type="button" value="<?php 
_e("Add webhook", 'hookpress');
?>
" title="<?php 
_e('Add new webhook', 'hookpress');
?>
" alt="#TB_inline?height=330&width=500&inlineId=hookpress-new-webhook"/>

<!--	<h3>General options</h3>