Restrict access to the Trash folder in Posts

With the filter we prevent the Trash link from being printed. And with the action, redirect back to the post listing page if the user tries to access the URL directly (/wp-admin/edit.php?post_status=trash&post_type=post). add_filter( ‘views_edit-post’, ‘wpse_74488_remove_trash_link’ ); add_action( ‘admin_head-edit.php’, ‘wpse_74488_block_trash_access’ ); function wpse_74488_remove_trash_link( $views ) { if( !current_user_can( ‘delete_plugins’ ) ) unset( $views[‘trash’] ); return $views; … Read more

Comments screen in backend, how to disable Quick Edit | Edit | History | Spam | for non admins

This is done filtering the *_row_actions. For the Comments screen (/wp-admin/edit-comments.php) this is the hook: add_filter( ‘comment_row_actions’, ‘comments_row_wpse_92313’, 15, 2 ); function comments_row_wpse_92313( $actions, $comment ) { if( !current_user_can( ‘delete_plugins’ ) ) unset( $actions[‘quickedit’], $actions[‘edit’], $actions[‘spam’] ); return $actions; } I cannot see a History option, maybe it’s included by some plugin (?). It’s a … Read more

Trash bin for categories

This would be quite challenging to implement. Posts can be trashed because: They have a concept of status and corresponding field in database table WordPress code “knows” to only deal with posts of appropriate status for most purposes This solves issues of visibility (posts won’t appear on front end) and interaction (trashed posts won’t show … Read more

How to add/retrieve the post trash link?

Just use get_delete_post_link( $post_ID ) – it’ll return the absolute URL with nonce and all! Just to be clear, this will get the link to trash posts (if trash supported). If you want to skip trash & get the perma-delete link, pass a second argument of true*. http://codex.wordpress.org/Function_Reference/get_delete_post_link Update: Having checked the source, it seems … Read more

Remove Trash / Delete option for Custom Post Type / Taxonomy

Try these: /** * Removes the “Trash” link on the individual post’s “actions” row on the posts * edit page. */ add_filter( ‘post_row_actions’, ‘remove_row_actions_post’, 10, 2 ); function remove_row_actions_post( $actions, $post ) { if( $post->post_type === ‘prj’ ) { unset( $actions[‘clone’] ); unset( $actions[‘trash’] ); } return $actions; } add_action(‘wp_trash_post’, ‘restrict_post_deletion’); function restrict_post_deletion($post_id) { if( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)