i have a site where i get posts from users, those posts save in WP as a custom post with status pending, Admin have custom link in that custom post type page Approve | Reject Approve should change post status to Public Reject Should change post status to trash/del
can anyone tell any hook to anything which i can run to change post status from backend by clicking these custom links
the code of approve | reject button if anyone want to see
add_filter( 'manage_dream_posts_columns', 'smashing_filter_posts_columns' );
function smashing_filter_posts_columns( $columns ) {
$columns['decision'] = __( 'Decision Pending', 'rima' );
return $columns;
}
add_action( 'manage_dream_posts_custom_column', 'smashing_dream_column', 10, 2);
function smashing_dream_column( $column, $post_id ) {
if ( 'decision' === $column ) {
if (get_post_status ( $post_id ) == 'pending') {
echo '<div class="decision"><a href="#" data-userID="'.$post_id.'" class="dapprove" onclick="decision()">Approve</a><a href="#" class="dreject">Reject</a></div>';
}
else {
echo '<div class="decision"><span class="dapprove">Approved</span></div>';
}
}
}