'How to always prepend a common to certain specific commands

I had three commands (composer, yarn, wp) that I would like to be always prepended with another command (lando) while still accepting parameters. So:

composer install --> lando composer install

yarn build:production --> lando yarn build:production

wp option get home --https://somesite --> lando wp option get home --https://somesite

and so on.

Aliased commands do not seem to accept parameters or flags.

I've found solutions for appending some commands, or for prepending all commands, but nothing for prepending only commands. Can this be done?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source