Skip to main content

Use Simply CLI

The boilerplate provides bin/console, with the commands of simply-maker and of the Simply extensions.

php bin/console list simply

bin/console loads WordPress: the database must be reachable. With the Docker environment, run it in the container: docker compose exec -u www-data web php bin/console ....

Clear the cache​

php bin/console simply:cache:clear

Run it when you deploy code changes that Composer does not see: see cache and deployment.

Debug the hooks​

php bin/console simply:debug:hook
php bin/console simply:debug:hook --hook_name=the_title
php bin/console simply:debug:hook --function_name=title
php bin/console simply:debug:hook --directory=my-plugin

Lists the registered WordPress hooks with, for each callback, its priority, its method or function, and its source file and line. Hooks declared with attributes are shown as Class:method, followed by the service id when it is not the class name.

  • --hook_name: one hook. An unknown name lists every hook.
  • --function_name: the callbacks whose method or function has this name.
  • --directory: the callbacks whose source file is in a directory of this name.

Generate code​

CommandGenerates
simply:make:plugina plugin: entry file, config/, src/, and prints the autoload line to add to composer.json
simply:make:themea theme: functions.php, index.php, style.css, config/, src/, views/
simply:make:hooka HookableInterface class in src/Hook/ and its YAML file
simply:make:post-typea post type in config/post-type/<slug>.yaml
simply:make:wpclicommanda WP-CLI command in src/Command/ and its YAML file
simply:make:controllera controller in src/Controller/ (with simply-mvc)

The commands ask questions: answer them, or keep the default values between brackets.

Contribute​

You can add commands in simply-maker. A Simply extension can also bring its own commands: every service extending Symfony's Command and named with #[AsCommand] is added to bin/console.