Under that test naming a police officer in a news article, or showing their picture, or saying that they in fact work for the police department could be subject to prosecution depending on the intent of the publisher. That's a ridiculous idea, and likely to lead to all kinds of abuse.
Presumably a defense to the law would be that the intent of the poster was simply educational, or news reporting, so that the 11:00 news anchor isn't at risk of being arrested and charged.
On its face the law would seem to raise a question of whether or not a police department arresting a police officer could publish their name and booking photograph.
It is a bad law. The protections it is trying to create against what might be called doxing of police officers should apply to everyone, or no one.
This looks like a right wing version of authoritarian control of speech. It is trivial compared to the massive left wing authoritarian control through speech codes, cancel culture, Big Tech censorship of anyone to the right of Mitt Romney, FBI harassment of key Trump supporters, etc. This is not a good law proposed by Oklahoma legislators, but we need to keep this in perspective.