The right way to connect the audio part of an A/V source like a DVD/BR or media exdender (WDTV) to a hometheater is with a direct cable. Putting anything in between could have adverse results, because you can’t be certain that the TV will output exactly the same bitstream thru the digital audio output, and even if it does, an A/V receiver does a better job of switching between different A/V sources than a TV, unless it’s a piece of junk or way older than the TV.
Anything else is just common sense: if your A/V receiver has HDMI inputs, connect it to the WDTV live with a HDMI cable. That should be the simplest and highest quality way of connecting it. Then you can use the video output of the receiver, either HDMI or component video depending on your TV. If you don’t feel like buying 2 HDMI cables, you can send the video output thru HDMI directly to the TV, and the audio thru toslink to the A/V receiver - that’s what I do myself - but you can’t bitstream newer audio codecs like DD true-HD or DTS-MA thru a toslink cable, only its DD/DTS lower definition “core”.
If the A/V receiver doesn’t have HDMI inputs/outputs just connect the toslink output to the receiver for sound and the component video output to the TV. If you want the convenience of switching between different A/V sources with your receiver’s remote, you can connect the component video output of the WDTV to the receiver and from there to the TV.