__( 'All', 'videopress-hq' ), 'mine' => __( 'Mine', 'videopress-hq' ), 'hold' => __( 'Pending', 'videopress-hq' ), 'approve' => __( 'Approved', 'videopress-hq' ), 'spam' => __( 'Spam', 'videopress-hq' ), 'trash' => __( 'Trash', 'videopress-hq' ), ); $available_comment_actions = array( 'approve' => __( 'Approve', 'videopress-hq' ), 'unapprove' => __( 'Unapprove', 'videopress-hq' ), 'reply' => __( 'Reply', 'videopress-hq' ), 'edit' => __( 'Edit', 'videopress-hq' ), 'spam' => __( 'Spam', 'videopress-hq' ), 'unspam' => __( 'Not Spam', 'videopress-hq' ), 'trash' => __( 'Trash', 'videopress-hq' ), 'untrash' => __( 'Restore', 'videopress-hq' ), 'delete' => __( 'Delete Permanently', 'videopress-hq' ), ); $current_status_filter = 'all'; $req_filter = filter_input( INPUT_GET, 'filter' ); if ( $req_filter && isset( $available_type_filter[ $req_filter ] ) ) { $current_status_filter = $req_filter; } $post = null; $req_post_id = filter_input( INPUT_GET, 'post_id', FILTER_VALIDATE_INT ); if ( $req_post_id && is_numeric( $req_post_id ) && $req_post_id > 0 ) { $post = get_post( (int) $req_post_id ); if ( $post && 'vp_video' !== $post->post_type ) { $post = null; } } $page = filter_input( INPUT_GET, 'paged', FILTER_VALIDATE_INT ); if ( ! is_numeric( $page ) || $page <= 0 ) { $page = 1; } // Helper function as lambda so we can use local vars (not in global context). $vphq_get_self_link = function ( $args = array() ) use ( $current_status_filter, $post ) { $default_args = array( 'filter' => $current_status_filter, ); if ( $post ) { $default_args['post_id'] = $post->ID; } $args = wp_parse_args( $args, $default_args ); return add_query_arg( $args, vphq_admin_page_link( 'comments' ) ); }; $query = new WP_Comment_Query( array( 'include_unapproved' => in_array( $current_status_filter, array( 'all', 'mine', 'hold' ) ), 'number' => 10, 'paged' => $page, 'orderby' => 'comment_date', 'order' => 'DESC', 'post_type' => 'vp_video', 'type' => 'comment', 'post_id' => $post ? $post->ID : 0, 'status' => $current_status_filter, 'no_found_rows' => false, ) ); $comments_count = $query->found_comments; $title = sprintf( /* translators: %s: Comments count. */ __( 'Comments (%s)', 'videopress-hq' ), number_format_i18n( $comments_count ) ); if ( $post ) { $post_title = get_the_title( $post ); if ( empty( $post_title ) ) { $post_title = __( '(no title)', 'videopress-hq' ); } $post_title = wp_html_excerpt( $post_title, 50, '…' ); $title = sprintf( /* translators: 1: Comments count, 2: Post title. */ __( 'Comments (%1$s) on “%2$s”', 'videopress-hq' ), number_format_i18n( $comments_count ), $post_title ); } ?>
comment_author ); ?> comment_author_url ) ) : ?> comment_author_url ); ?> comment_author_email ) ) : ?> comment_author_email ); ?> comment_author_IP ) ) : ?> comment_author_IP ); ?> |
comment_content ); ?>
comment_ID ),
'videopress_hq_update_comment_status-' . $comment->comment_ID
);
if ( 'edit' === $comment_action ) {
$link = admin_url( 'comment.php?action=editcomment&c=' . $comment->comment_ID );
}
?>
|
comment_post_ID ) ); ?> | comment_date_gmt ); ?> |