remove edit link only for published post and pending post

Try this, where I changed the function to accept the second parameter which is the current post in the list table: add_filter( ‘post_row_actions’, ‘remove_row_actions’, 10, 2 ); function remove_row_actions( $actions, $post ) { if ( $post && ‘post’ === $post->post_type && in_array( $post->post_status, array( ‘publish’, ‘pending’ ) ) ) { unset( $actions[‘edit’] ); } return … Read more

How can I show a specific page to admins only?

if not admin redirects to front page try this function in the top of the file if(!current_user_can(‘administrator’)){ echo ‘<a href=”‘.home_url().'” id=”notAdmin”></a>’; echo ‘<script>document.getElementById(“notAdmin”).click();</script>’; }