试试这个,我将函数改为接受second parameter 列表中的当前职位:
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 $actions;
}