Great code snippet! Would love to know how to remove the “trash” function housed above the list of posts, as well as on the edit post page. basically, I want to take away any users ability to trash ANY post. thanks!

Grant glad you like the snippet, in regards to your request you could always insert CSS using the admin_head hook and display none the class=”delete-action” would not disable the function but would hide the button. You can see this snippet to get the idea just change the css used.

You probably discourage this type of request. I am trying to add this snippet to WP. I am a PHP virgin and have messed up the syntax on inserting the code. I am an amateur at SQL and thought I could apply my limited knowledge process to this and I’ve fouled up” I’ve placed it at the end of the /public_html/wp-content/themes/twentyten function file. I can’t get the closing syntax correct. Do I need to add an endif; to close the file? Or, should I paste the snippet into a different location in the file. I appreciate your help.

@SurfinUSA:disqus you will notice within the functions.php at the start you have a the location does not matter for this snippet but it needs to be between the of the file.

SurfinUSA

Kevin,

I’m sorry. The symbols you used to designate where the snippet must be located did not appear either on your web page or in the confirming e-mail I received below. Could you find another way to indicate the location where I need to insert the snippet?

You will notice on line 04: if( get_post_type() === ‘post’ ) the post type is post if you change that to the custom post type name that should do it. However if you want to apply to every post and post type just remove line 04 altogether.

How can I make these columns appear on a custom columns that I’ve added.

I am adding a Testimonial post, which doesn’t support title in my case. And, hence I want to be able to show all options “the link, edit, trash, view, delete” links that appear on Title column to appear on this new column – Client name.

pritee

Thanks a lot..

liz

it doesn’t work for post_type = ‘page’, but working smoothly for custom post type. Any solution for this? thx before

About wpsnipp

WPSNIPP Was founded in 2010 by Kevin Chard and is a free resource dedicated to WordPress covering a wide range of topics. With over 640+ WordPress snippets, we also have tutorials, plugins, gallery and deals to enhance all aspects of your WordPress theme or blog.