File tree 2 files changed +46
-0
lines changed
2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -399,6 +399,29 @@ entirely.
399
399
| 2 | home | http://wordpress-develop.dev | yes |
400
400
+---+------+------------------------------+-----+
401
401
402
+ ** MULTISITE USAGE**
403
+
404
+ Please note that the global ` --url ` parameter will have no effect on this command.
405
+ In order to query for data in a site other than your primary site,
406
+ you will need to manually modify the table names to use the prefix that includes the site's ID.
407
+
408
+ For example, to get the ` home ` option for your second site, modify the example above like so:
409
+
410
+ $ wp db query 'SELECT option_value FROM wp_2_options WHERE option_name="home"' --skip-column-names
411
+ +----------------------+
412
+ | https://example2.com |
413
+ +----------------------+
414
+
415
+ To confirm the ID for the site you want to query, you can use the ` wp site list ` command:
416
+
417
+ # wp site list --fields=blog_id,url
418
+ +---------+-----------------------+
419
+ | blog_id | url |
420
+ +---------+-----------------------+
421
+ | 1 | https://example1.com/ |
422
+ | 2 | https://example2.com/ |
423
+ +---------+-----------------------+
424
+
402
425
403
426
404
427
### wp db export
Original file line number Diff line number Diff line change @@ -457,6 +457,29 @@ public function cli( $_, $assoc_args ) {
457
457
* +---+------+------------------------------+-----+
458
458
* | 2 | home | http://wordpress-develop.dev | yes |
459
459
* +---+------+------------------------------+-----+
460
+ *
461
+ * ## MULTISITE USAGE
462
+ *
463
+ * Please note that the global `--url` parameter will have no effect on this command.
464
+ * In order to query for data in a site other than your primary site,
465
+ * you will need to manually modify the table names to use the prefix that includes the site's ID.
466
+ *
467
+ * For example, to get the `home` option for your second site, modify the example above like so:
468
+ *
469
+ * $ wp db query 'SELECT option_value FROM wp_2_options WHERE option_name="home"' --skip-column-names
470
+ * +----------------------+
471
+ * | https://example2.com |
472
+ * +----------------------+
473
+ *
474
+ * To confirm the ID for the site you want to query, you can use the `wp site list` command:
475
+ *
476
+ * # wp site list --fields=blog_id,url
477
+ * +---------+-----------------------+
478
+ * | blog_id | url |
479
+ * +---------+-----------------------+
480
+ * | 1 | https://example1.com/ |
481
+ * | 2 | https://example2.com/ |
482
+ * +---------+-----------------------+
460
483
*/
461
484
public function query ( $ args , $ assoc_args ) {
462
485
You can’t perform that action at this time.
0 commit comments