Skip to content

--slug= option of wp site delete works wrong for numeric paths #441

@vanushwashere

Description

@vanushwashere

Bug Report

Are you unsure about which repository to post the bug report into?

Describe the current, buggy behavior

In case when I have subdomains with numeric slugs, wp site delete --slug=4 searches for the site with id=4, not the site with the slug=4 like 4.example.com.

Describe how other contributors can replicate this bug

  • create a site with a numeric slug, like 42
  • run wp site delete --slug=42
  • you'll get the error that site doesn't exist

Describe what you expect as the correct outcome

  • create a site with a numeric slug, like 42
  • run wp site delete --slug=42
  • 42.example.com site is deleted

Let us know what environment you are running this on

OS:     Linux 4.15.0-1044-gcp wp-cli/wp-cli#46-Ubuntu SMP Mon Sep 16 12:52:27 UTC 2019 x86_64
Shell:
PHP binary:     /usr/bin/php7.3
PHP version:    7.3.9-1+ubuntu16.04.1+deb.sury.org+1
php.ini used:   /etc/php/7.3/cli/php.ini
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /home/wplive/web/wp-live
WP-CLI packages dir:
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.4.0

Provide additional context/screenshots
image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions