A Woonsocket police officer has pleaded guilty to a civil rights charge in the beating of a teenage boy in his custody.