As @storm identified there is indeed a way to do this, for the specific functionality you mentioned in your question. See storm's answer.
It seems that what you're looking for is a set of "hooks" to allow you to add functionality to different parts of the shell. As fun as it sounds, bash doesn't have much of that.
The purpose of PROMPT_COMMAND
is generally considered to be to set up stuff that will be used by your prompt. This SO question has some answers that demonstrate how it might be used for this. Of course, you can use it for other things (it's a hook after all), but the fact that it gets executed before your prompt kind of relates it to your prompt.
If you decide to trap for DEBUG, you should be aware that the trap doesn't follow you into functions, but a trap set within a function follows you back into the calling shell:
$ function red { trap "echo world" DEBUG; echo "RED"; echo "RED"; }
$ function blue { echo "BLUE"; echo "BLUE"; }
$ trap "echo hello" DEBUG
$ red
hello
world
RED
world
RED
$ blue
world
BLUE
BLUE
If you want a trap like this to be local to the function, you must define the function as a subshell, for instance:
$ red() ( trap "echo world" DEBUG; echo "RED"; echo "RED" )
which is equivalent to:
$ function red { ( trap "echo world" DEBUG; echo "RED"; echo "RED" ); }
I don't see this trap-within-a-function behaviour documented anywhere, and it seems a little approximate to me. I wouldn't be surprised if it changed in future versions of bash.
I can't speak for Chet, but I doubt we'll be seeing much hook functionality get added to bash 4. No idea what new functionality might be in the works for future versions.