ap_comment_actions( object|integer $comment )
Description #
Comment actions args.
Parameters #
- $commentobject | integer (Required) Comment object.
Source #
File: includes/comments.php
function ap_comment_actions( $comment ) { $comment = get_comment( $comment ); $actions = array(); if ( ap_user_can_edit_comment( $comment->comment_ID ) ) { $actions[] = array( 'title' => __( 'Edit this Comment', 'anspress-question-answer' ), 'label' => __( 'Edit', 'anspress-question-answer' ), 'href' => '#', 'query' => array( 'action' => 'comment_modal', '__nonce' => wp_create_nonce( 'edit_comment_' . $comment->comment_ID ), 'comment_id' => $comment->comment_ID, ), ); } if ( ap_user_can_delete_comment( $comment->comment_ID ) ) { $actions[] = array( 'title' => __( 'Delete this Comment', 'anspress-question-answer' ), 'label' => __( 'Delete', 'anspress-question-answer' ), 'href' => '#', 'query' => array( '__nonce' => wp_create_nonce( 'delete_comment_' . $comment->comment_ID ), 'ap_ajax_action' => 'delete_comment', 'comment_id' => $comment->comment_ID, ), ); } if ( '0' === $comment->comment_approved && ap_user_can_approve_comment() ) { $actions[] = array( 'title' => __( 'Approve this Comment', 'anspress-question-answer' ), 'label' => __( 'Approve', 'anspress-question-answer' ), 'href' => '#', 'query' => array( '__nonce' => wp_create_nonce( 'approve_comment_' . $comment->comment_ID ), 'ap_ajax_action' => 'approve_comment', 'comment_id' => $comment->comment_ID, ), ); } /** * For filtering comment action buttons. * * @param array $actions Comment actions. * @since 2.0.0 */ return apply_filters( 'ap_comment_actions', $actions ); }
Expand full source code Collapse full source code View on GitHub: includes/comments.php:266
Add your comment