Skip to content

Custom global parameters #126

@david-binda

Description

@david-binda

WP CLI Hooks triggering at various points of the WP CLI execution before WordPress is loaded theoretically allow package developers to not only introduce new commands, but also modify some bits of the WordPress load and behaviour (similarly to the skip-themes, skip-plugins, and/or skip-packages flags).

But there does not seem to be a way to properly register custom global parameters in WP CLI internal API, so my attempts to add any custom flag to all registered commands ends up with Parameter errors.

I believe that it would be cool to allow package developers to register a custom global parameters in order to provide some modified behaviour for WP CLI / WordPress.

It also feels like a possible internal api implementation, WP_CLI::register_config_key, was being considered in terms of wp-cli/wp-cli#520

Based on the approved status of #104 it looks like global parameters are currently being regarded as something what does not get changed often, so the possible drawback would be the unpredictability of all existing global parameters in a specific installation, which could get fixed by introducing a new section of package registered global parameters, which would not be excluded in case the suppress_global_params is set.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions