When people use words that have nothing to do with race to refer to race

Solution 1:

EUPHEMISM noun; plural noun: euphemisms

a mild or indirect word or expression substituted for one considered to be too harsh or blunt when referring to something unpleasant or embarrassing. “downsizing” as a euphemism for cuts"

synonyms: polite term, indirect term, circumlocution, substitute, alternative, understatement, genteelism see google.com, “euphemism”

CODED LANGUAGE

If someone is using coded language, they are expressing their opinion in an indirect way, usually because that opinion is likely to offend people. See reverso link

example of the use of coded language:

New Gingrich has repeatedly referred to President Obama as “The Food Stamp” President while contrasting that with his own aims to become “The Paycheck” President.

From the crunkfeministcollective

Whether the use of euphemisms or coded language is racist or not cannot really be definitively answered because one never knows what the inner motives of another person are. However, because these types of expression can seem or feel racist or prejudicial they should be avoided by anyone who wants to be clearly understood.

Solution 2:

This type of language or communication strategy is often referred to now as a "dog whistle." This is because a dog whistle produces a sound that is heard by an intended audience (dogs) but not by most people.

U.S. President Trump is often accused by commentators of using dog-whistle tactics to disparage certain races without actually identifying a race (i.e., Black) by name. This is the situation mentioned in the question.

So, what is it called when people use words like "urban" to refer to race? It's a "dog whistle" if the point is to sound like you are criticizing a thing or a place when you are actually linking an entire race to a negative condition.