Using wpjobmanager plugin for my site gojobr.com.au :
I've encountered a problem: to combat spam users that keep posting the same spammy jobs (they are doing so manually so no a captcha won't solve the issue), I wanted to create an easy way to delete a user from the job_listings admin page ( wp-admin/edit.php?post_type=job_listing ).
I entered the following code and the column is appearing correctly on the job_listings page, however the nonce generated is different (and not working) to the wp-core users list admin page's user-delete link (which uses the exact same code as below). (located at wp-admin/includes/class-wp-users-list-table.php line 372):
// Populate content for this custom column add_action( 'manage_job_listing_posts_custom_column', 'gjcontent_job_listing_posts_custom_column', 99);
function gjcontent_job_listing_posts_custom_column($column) { /* @var $post WP_Post */ global $post;
switch ($column) {
case 'user_info' :
if ( empty( $post->post_author) ) {
echo ' ';
} else {
$del_url = 'users.php?action=delete&user=' . $post->post_author;
echo '<a href="' . wp_nonce_url($del_url) . '" title="Delete user">Delete</a>'; //nonce not working :-(
}
break;
}
}