Skip to content

Avoid use of @WP_CLI::get_runner()->load_wordpress(); in wp db * commands #50

@danielbachhuber

Description

@danielbachhuber

wp db search (and other wp db * commands) call @WP_CLI::get_runner()->load_wordpress(); because WP-CLI executes wp db * commands after wp-config.php has loaded but before the rest of WordPress has loaded: https://github.com/wp-cli/wp-cli/blob/d9d405a4ca01ba23e80277b8cb9000857e84e0cd/php/WP_CLI/Runner.php#L875

Calling @WP_CLI::get_runner()->load_wordpress(); to avoid redefinition of constants in wp-config.php is a hack. Instead, these commands should continue loading WordPress without loading wp-config.php again.

Related #15

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions