On a related note, how would you substitute for a derivative? Say I have
fun = D[f[x, y, t], x] + D[f[x, y, t], {x, 2}] + D[f[x, y, t], {x, 3}]
and want to make the substitution
$\partial_xf \rightarrow g$ so that fun goes from
$$\partial_xf +\partial_{xx}f + \partial_{xxx}f$$ to
$$g + \partial_xg + \partial_{xx}g. $$
This doesn't work:
fun /. D[f[x, y, t], x] -> (g[#, #2, #3] &)
and
fun /. f^(1,0,0)->(g[#,#2,#3]&)
only replaces the one derivative.