wp-cli / entity-command

Manage WordPress comments, menus, options, posts, sites, terms, and users.
MIT License
100 stars 89 forks source link

site delete: allow deleting a site with the --url option #506

Open 35grain opened 3 months ago

35grain commented 3 months ago

Feature Request

Describe your use case and the problem you are facing

Currently the blog ID or slug must be specified when using the command. In cases where a custom domain is used, however, the --slug option fails and it is tedious to look up the assigned site ID in an automated use case.

Describe the solution you'd like

Allow site deletion by only specifying the --url option. For example: wp site delete --url="http://example.com".

35grain commented 3 months ago

get_blog_id_from_url() could probably be used here as with get_id_from_blogname() and the --slug option?

swissspidy commented 1 month ago

We could implement wp site get <id|url> instead, then one could pair wp site delete with wp site get http://example.com --field=id. This would be more in line with all the other commands.