[EDITED TO CORRECT LEFT/RIGHT CONFUSION]
- Let $f$ be a function defined by $f(x)=mx$.
It is possible to produce a horizontal shift of $a$ units to the right ( provided $a$ is positive) by defining a function $g$ such that $g(x)=f(x-a)$.
This horizontal shift also produces a vertical shift, but the formula works inasmuch as the intended horizontal shift occurs.
- However, the intended shift does not occur, or occurs not in the intended way, when one defines a function $h$ as follows : $h(x)= f(x-a)+b$ .
For in that case, the vertical shift perturbates, so to say, the intended horizontal shift.
- Hence my question: should one say that the rule " $h(x)=f(x-a)+b$ produces a horizontal shift of $a$ units ( to the left or to the right, depending on the sign of $a$) and a vertical shift of $b$ units ( up or down) " only works for non-linear functions?
Note : my question does not deal with the vertical shift , which , apparently, always occurs in the intended way.
Below, an xample, with an intended shift of $4$ units ( to the right) and an actual shift of $5$ units.


Both other answers are right, I just point out something more general and something more specific to your example:
Generally, for a linear function with slope $m$, a ("horizontal") shift by $a$ units to the right is the same as a ("vertical") shift by $m \cdot a$ units down; and a ("vertical") shift by $b$ units up is the same as a ("horizontal") shift by $\frac{b}{m}$ units to the left. Or, purely algebraically, if $f(x) = mx + c$, then
$$f(x-a) = mx-ma+c = f(x) -ma, \;\text{ and } \\ f(x)+b = mx+b+c = m(x+\frac{b}{m})+c= f(x+\frac{b}{m})$$
Specifically, for your example function $f(x) =-2.4x$, your combined shift of $4$ units to the right and $2.3$ units up,
$$f(x-4) + 2.3,$$
can also be expressed as as shift of $4 + \frac{2.3}{2.4} = 4.958\bar 3 \approx 4.96$ (not $5$, look closer!) units to the right,
$$=f(x -4.958\bar3),$$
or as a shift of $(-2.4) \cdot (-4) + 2.3=11.9$ units up,
$$=f(x) +11.9$$
(check the $y$-intercept of the new function). Or, as infinitely many other combinations of vertical and horizontal shifts, for example
$$=f(x+0.4)+12.9 = f(x-17)-28.9= ... ... .$$