posts – Disable “Quick edit” for roles in WP dashboard
Question
How can you disable the “quick edit” link in posts in WP dashboard for roles with following conditions:
- The “Delete” ability shall stay
- the “View” post ability shall stay
- The “Edit” ability shall be removed
I tried this code in functions.php:
if ( current_user_can('manage_options') ) {} else {
add_filter('post_row_actions','remove_quick_edit',10,1);}
But this code prevents you also from deleting the post. The DELETE link (delete to wastebasket) shall be preserved.
Then, I tried this code in functions.php:
function remove_quick_edit( $actions ) {
unset($actions['inline hide-if-no-js']);
return $actions;} if ( ! current_user_can('manage_options') ) {
add_filter('post_row_actions','remove_quick_edit',10,1);}
But this code enables the EDIT link.
I refer to this post:
Disable “quick edit” only for non admin in functions.php
0
2 months
2023-02-05T06:25:46-05:00
2023-02-05T06:25:46-05:00 0 Answers
0 views
0
Leave an answer