ID ); //wp 3.3 fix global $post; $pagenum = isset( $_GET['pagenum'] ) ? intval( wp_unslash( $_GET['pagenum'] ) ) : 1; $action = isset( $_REQUEST['action'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['action'] ) ) : ''; // delete post if ( $action == 'del' ) { $nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_key( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; if ( isset( $nonce ) && !wp_verify_nonce( $nonce, 'wpuf_del' ) ) { return ; } //check, if the requested user is the post author $pid = isset( $_REQUEST['pid'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['pid'] ) ) : ''; $type = isset( $_REQUEST['section'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['section'] ) ) : ''; $maybe_delete = get_post( $pid ); if ( ( $maybe_delete->post_author == $userdata->ID ) || current_user_can( 'delete_others_pages' ) ) { wp_delete_post( $pid ); //redirect $redirect = add_query_arg( [ 'section' => $type, 'msg' => 'deleted'], get_permalink() ); wp_redirect( $redirect ); exit; } else { echo wp_kses_post( '
' . __( 'You are not the post author. Cheating huh!', 'wp-user-frontend' ) . '
' ); } } // show delete success message $msg = isset( $_GET['msg'] ) ? sanitize_text_field( wp_unslash( $_GET['msg'] ) ) : ''; if ( $msg == 'deleted' ) {?>

get_current_user_id(), 'post_status' => ['draft', 'future', 'pending', 'publish', 'private'], 'post_type' => $post_type, 'posts_per_page' => wpuf_get_option( 'per_page', 'wpuf_dashboard', 5 ), 'paged' => $pagenum, ]; $original_post = $post; $dashboard_query = new WP_Query( apply_filters( 'wpuf_dashboard_query', $args ) ); $post_type_obj = get_post_type_object( $post_type ); ?> ID, $post_type_obj ); ?> have_posts() ) { ?> current_pack(); $sub_id = $current_user->subscription()->current_pack_id(); if ( $sub_id ) { $subs_expired = $user_subscription->expired(); } else { $subs_expired = false; } ?>
' . __( 'Featured Image', 'wp-user-frontend' ) . '' ); } ?> have_posts() ) { $dashboard_query->the_post(); $show_link = !in_array( $post->post_status, ['draft', 'future', 'pending'] ); $payment_status = get_post_meta( $post->ID, '_wpuf_payment_status', true ); ?>
ID ) . '">' ) : ''; if ( has_post_thumbnail() ) { the_post_thumbnail( $featured_img_size ); } else { printf( '%2$s', esc_attr( apply_filters( 'wpuf_no_image', plugins_url( '../assets/images/no-image.png', __DIR__ ) ) ), esc_html( __( 'No Image', 'wp-user-frontend' ) ) ); } echo $show_link ? '' : ''; ?> post_status ); ?> $post->ID], get_permalink( $edit_page ) ); $show_edit = true; if ( $post->post_status == 'pending' && $disable_pending_edit == 'on' ) { $show_edit = false; } if ( ( $post->post_status == 'draft' || $post->post_status == 'pending' ) && ( !empty( $payment_status ) && $payment_status != 'completed' ) ) { $show_edit = false; } if ( $subs_expired ) { $show_edit = false; } if ( $show_edit ) { ?> 'del', 'pid' => $post->ID] ); $message = __( 'Are you sure to delete?', 'wp-user-frontend' ); ?>
add_query_arg( 'pagenum', '%#%' ), 'format' => '', 'prev_text' => __( '«', 'wp-user-frontend' ), 'next_text' => __( '»', 'wp-user-frontend' ), 'total' => $dashboard_query->max_num_pages, 'current' => $pagenum, 'add_args' => false, ] ); if ( $pagination ) { echo wp_kses( $pagination, [ 'span' => [ 'aria-current' => [], 'class' => [], ], 'a' => [ 'href' => [], 'class' => [], ] ] ); } ?>
' . esc_attr( __( 'No %s found', 'wp-user-frontend' ) ) . '', esc_html( $post_type_obj->label ) ); do_action( 'wpuf_account_posts_nopost', $userdata->ID, $post_type_obj ); } wp_reset_postdata();