Skip to content

(docs) The "site list" URL field comes from the wp_options table, not wp_blogs #400

@pwtyler

Description

@pwtyler

The docs for wp site list remark:

[--<field>=<value>]
  Filter by one or more fields (see "Available Fields" section). However,
  'url' isn't an available filter, because it’s created from domain + path.

I discovered while chasing an elusive bug that this value in fact is set to the home value in wp_options.

Steps to reproduce:

$ wp site list --fields=domain,path,url
l
+----------------------------+----------------------------------+-------------------------------------------------------------------+
| domain                     | path                             | url                                                               |
+----------------------------+----------------------------------+-------------------------------------------------------------------+
| dev-srtest.pantheonsite.io | /                                | https://dev-srtest.pantheonsite.io/                               |
| dev-srtest.pantheonsite.io | /about/                          | http://dev-srtest.pantheonsite.io/about/                          |
| dev-srtest.pantheonsite.io | /sremployeeresources-com/        | http://dev-srtest.pantheonsite.io/sremployeeresources-com/        |
| dev-srtest.pantheonsite.io | /staff-portal-dashboard/         | http://dev-srtest.pantheonsite.io/staff-portal-dashboard/         |
| dev-srtest.pantheonsite.io | /srcustomerportal-com-dashboard/ | http://dev-srtest.pantheonsite.io/srcustomerportal-com-dashboard/ |
| dev-srtest.pantheonsite.io | /hr-department/                  | http://dev-srtest.pantheonsite.io/hr-department/                  |
+----------------------------+----------------------------------+-------------------------------------------------------------------+
$ wp option update home "https://test-srtest.pantheonsite.io/about" --url=dev-srtest.pantheonsite.io/about
Success: Updated 'home' option.
$ wp site list --fields=domain,path,url
+----------------------------+----------------------------------+-------------------------------------------------------------------+
| domain                     | path                             | url                                                               |
+----------------------------+----------------------------------+-------------------------------------------------------------------+
| dev-srtest.pantheonsite.io | /                                | https://dev-srtest.pantheonsite.io/                               |
| dev-srtest.pantheonsite.io | /about/                          | https://test-srtest.pantheonsite.io/about/                        |
| dev-srtest.pantheonsite.io | /sremployeeresources-com/        | http://dev-srtest.pantheonsite.io/sremployeeresources-com/        |
| dev-srtest.pantheonsite.io | /staff-portal-dashboard/         | http://dev-srtest.pantheonsite.io/staff-portal-dashboard/         |
| dev-srtest.pantheonsite.io | /srcustomerportal-com-dashboard/ | http://dev-srtest.pantheonsite.io/srcustomerportal-com-dashboard/ |
| dev-srtest.pantheonsite.io | /hr-department/                  | http://dev-srtest.pantheonsite.io/hr-department/                  |
+----------------------------+----------------------------------+-------------------------------------------------------------------+

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions