本文整理汇总了PHP中comment_footer_die函数的典型用法代码示例。如果您正苦于以下问题:PHP comment_footer_die函数的具体用法?PHP comment_footer_die怎么用?PHP comment_footer_die使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了comment_footer_die函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: absint
case 'unspamcomment' :
case 'approvecomment' :
case 'unapprovecomment' :
$comment_id = absint( $_REQUEST['c'] );
if ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) )
check_admin_referer( 'approve-comment_' . $comment_id );
else
check_admin_referer( 'delete-comment_' . $comment_id );
$noredir = isset($_REQUEST['noredir']);
if ( !$comment = get_comment($comment_id) )
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">' . __('Go back') . '</a>.', 'edit-comments.php') );
if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
comment_footer_die( __('You are not allowed to edit comments on this post.') );
if ( '' != wp_get_referer() && ! $noredir && false === strpos(wp_get_referer(), 'comment.php') )
$redir = wp_get_referer();
elseif ( '' != wp_get_original_referer() && ! $noredir )
$redir = wp_get_original_referer();
elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) )
$redir = admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) );
else
$redir = admin_url('edit-comments.php');
$redir = remove_query_arg( array('spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids', 'approved', 'unapproved'), $redir );
switch ( $action ) {
case 'deletecomment' :
wp_delete_comment( $comment_id );
示例2: absint
}
exit;
break;
case 'approvecomment':
$comment_id = absint($_GET['c']);
check_admin_referer('approve-comment_' . $comment_id);
if (isset($_GET['noredir'])) {
$noredir = true;
} else {
$noredir = false;
}
if (!($comment = get_comment($comment_id))) {
comment_footer_die(__('Oops, no comment with this ID.') . sprintf(' <a href="%s">' . __('Go back') . '</a>!', 'edit.php'));
}
if (!current_user_can('edit_post', $comment->comment_post_ID)) {
comment_footer_die(__('You are not allowed to edit comments on this post, so you cannot approve this comment.'));
}
wp_set_comment_status($comment->comment_ID, 'approve');
if ('' != wp_get_referer() && false == $noredir) {
wp_redirect(wp_get_referer());
} else {
wp_redirect(admin_url('edit-comments.php?p=' . absint($comment->comment_post_ID) . '#comments'));
}
exit;
break;
case 'editedcomment':
$comment_id = absint($_POST['comment_ID']);
$comment_post_id = absint($_POST['comment_post_ID']);
check_admin_referer('update-comment_' . $comment_id);
edit_comment();
$location = (empty($_POST['referredby']) ? "edit-comments.php?p={$comment_post_id}" : $_POST['referredby']) . '#comment-' . $comment_id;
示例3: my_ajax
function my_ajax()
{
comment_footer_die("chao the gioi");
}
示例4: process_contribution_action
/**
* Process the selected action for a single contribution
*
* @since 1.0.0
*/
public function process_contribution_action()
{
if (!isset($_REQUEST['action']) || !isset($_REQUEST['c'])) {
return;
}
switch ($_REQUEST['action']) {
case 'flagcomment':
$comment_id = absint($_REQUEST['c']);
check_admin_referer('delete-comment_' . $comment_id);
$noredir = isset($_REQUEST['noredir']);
if (!($comment = get_comment($comment_id))) {
comment_footer_die(__('Oops, no comment with this ID.', WC_Product_Reviews_Pro::TEXT_DOMAIN) . sprintf(' <a href="%s">' . __('Go back', WC_Product_Reviews_Pro::TEXT_DOMAIN) . '</a>.', 'admin.php?page=contributions'));
}
if ('' != wp_get_referer() && !$noredir && false === strpos(wp_get_referer(), 'page=contributions')) {
$redir = wp_get_referer();
} elseif ('' != wp_get_original_referer() && !$noredir) {
$redir = wp_get_original_referer();
} else {
$redir = admin_url('admin.php?page=contributions');
}
$redir = remove_query_arg(array('ids', 'flagged'), $redir);
$contribution = wc_product_reviews_pro_get_contribution($comment_id);
if ($contribution && $contribution->flag()) {
$redir = add_query_arg(array('flagged' => '1'), $redir);
}
wp_redirect(esc_url_raw($redir));
exit;
break;
}
}
示例5: save_meta_box_postdata
function save_meta_box_postdata($comment_id)
{
if (!wp_verify_nonce($_POST['featured_comments_nonce'], plugin_basename(__FILE__))) {
return;
}
if (!current_user_can('moderate_comments', $comment_id)) {
comment_footer_die(__('You are not allowed to edit comments on this post.', 'featured-comments'));
}
update_comment_meta($comment_id, 'featured', isset($_POST['featured']) ? '1' : '0');
update_comment_meta($comment_id, 'buried', isset($_POST['buried']) ? '1' : '0');
}