Remove "Trash" from Wordpress Pages -
i trying remove "trash" link wordpress pages in wp-admin. have managed create function removes posts cannot seem find info on doing same pages.
function removing trash link posts:
<?php add_filter( 'post_row_actions', 'remove_row_actions', 10, 1 ); function remove_row_actions( $actions ) { if( get_post_type() === 'post' ) unset( $actions['clone'] ); unset( $actions['trash'] ); return $actions; } ?>
paste below code function.php , check in post/page section in admin
add_filter( 'post_row_actions', 'remove_row_actions_post', 10, 1 ); function remove_row_actions_post( $actions ) { if( get_post_type() === 'post' ) { unset( $actions['clone'] ); unset( $actions['trash'] ); return $actions; } } add_filter( 'page_row_actions', 'remove_row_actions_page', 10, 1 ); function remove_row_actions_page( $actions ) { if( get_post_type() === 'page' ) { unset( $actions['clone'] ); unset( $actions['trash'] ); return $actions; } }
Comments
Post a Comment