It depends. Especially when producing images that are viewed in monochrome/B&W.
If digital sensors had unlimited dynamic range it wouldn't matter so much, but we all know that they are limited by their noise floor.
By using the color filter at the time you shoot, you can reduce a particular color channel that might otherwise be blown out while still preserving the brightness of the other two color channels. For instance, if the scene has a lot more brightness in the red channel than I want in the final image I can use a green filter to reduce the amount of red without reducing the green (and to a lesser extent the blue) as well. The green filter might also allow me to expose so that the greens and blues are even brighter while still keeping the reds below full saturation.
But today, with digital cameras, would I just instead shoot in color, apply the yellow filter in post (or whatever other color filters I want), and then convert the image to black and white?
Not exactly. Digital filters don't always work the same way that actual physical filters do, and so they don't always give the same results. You may be able to get very close, but there's still no substitute for using actual filters if you're planning on presenting the image with a particular balance between certain colors and the gray tones they produce in monochrome.
With most general raw converters that have a dedicated "Monochrome" tab, the number and color of filters that can be applied are usually fairly limited. The available choices usually might be something like Red→Orange→Yellow→None→Green. But you often can't alter the density/strength of a specific filter color. If you want a specific color between these choices, or say you want a blue filter, you're often out of luck.
Dedicated B&W/Monochrome editing applications or plugins like Nik's Silver Efex Pro or Topaz B&W Effects often add many more choices including specific filters in varying strengths. They may even be labeled by the names of their analog counterparts e.g. Lee #8 Yellow or B&W Light Red 090. But they still act upon light after it has been recorded by your sensor, rather than before. So the limitations of a camera's dynamic range will limit, to one degree or another, how close to using an actual filter you can get by doing it in post processing.
What you set for color temperature and fine tuning along the Blue←→Yellow and Magenta←→Green axes will have an effect, but it won't always be the same as using a color filter would. When you adjust the color temperature pretty much all of the colors are shifted in one direction or another. Color filters are much more selective about which colors are affected. You could use the Hue Saturation Luminance (HSL) tool in many post processing applications to fine tune a little more, but you've still unnecessarily limited your camera's dynamic range more than you would by applying the filter to the light before exposure so that you can utilize more of your camera's dynamic range only on the light that you want to capture.
You can reduce contrast in post, for example, to mimic the effect of a blue filter but it may not give you the exact same effect. Again, you are also sacrificing dynamic range by applying the filter to the digital information after it was recorded rather than to the light before it was recorded.