You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using CLI-over-SSH, it is not possible to use ambiguous arguments to set local, command-specific values, even when using WP_CLI_STRICT_ARGS_MODE=1.
For example, I want to add a RSS widget to a sidebar. In this case, the ambiguous --url parameter relates to the url property of the widget (i.e. the feed URL).
Steps to reproduce
Have a VM, with a working WordPress site and WP-CLI.
Outside the VM, in a project directory, have a wp-cli.yml containing this: https://gist.github.com/paulgibbs/028279cf5c1dbb5882c27a36f2e80598 (You will need to change the details to match your VM). Verify you can run WP-CLI commands within the VM via wp @vagrant ... (etc).
Outside the VM, run: wp @vagrant widget add rss sidebar-1 --title='My feedx' --url='https://wordpress.org/news/feed/' --items='3'. Check the website and confirm that a new widget was added. Note the URL property on the widget will be empty.
Manually remove the widget to tidy-up.
Outside the VM, to (try to) resolve the command ambiguity, run: WP_CLI_STRICT_ARGS_MODE=1 wp @vagrant widget add rss sidebar-1 --title='My feedx' --url='https://wordpress.org/news/feed/' --items='3'. Check the website and confirm that a new widget was added. Note the URL property on the widget will still be empty.
Expected Results
Running this command over SSH with WP_CLI_STRICT_ARGS_MODE=1 set should create the widget with its URL property correctly populated.
Actual Results
The widget is created but its URL property is empty.
Workaround
None known. This issue is reported using the RSS widget, but I suspect the same issue will occur with other commands that rely on ambiguous arguments.
My suspicion is that when CLI makes the SSH connection to the specified server, it is not passing the value of WP_CLI_STRICT_ARGS_MODE if set, but I have not investigated this.
While using CLI-over-SSH, it is not possible to use ambiguous arguments to set local, command-specific values, even when using
WP_CLI_STRICT_ARGS_MODE=1
.For example, I want to add a RSS widget to a sidebar. In this case, the ambiguous
--url
parameter relates to theurl
property of the widget (i.e. the feed URL).Steps to reproduce
wp-cli.yml
containing this: https://gist.github.com/paulgibbs/028279cf5c1dbb5882c27a36f2e80598 (You will need to change the details to match your VM). Verify you can run WP-CLI commands within the VM viawp @vagrant ...
(etc).wp @vagrant widget add rss sidebar-1 --title='My feedx' --url='https://wordpress.org/news/feed/' --items='3'
. Check the website and confirm that a new widget was added. Note the URL property on the widget will be empty.WP_CLI_STRICT_ARGS_MODE=1 wp @vagrant widget add rss sidebar-1 --title='My feedx' --url='https://wordpress.org/news/feed/' --items='3'
. Check the website and confirm that a new widget was added. Note the URL property on the widget will still be empty.Expected Results
Running this command over SSH with
WP_CLI_STRICT_ARGS_MODE=1
set should create the widget with its URL property correctly populated.Actual Results
The widget is created but its URL property is empty.
Workaround
None known. This issue is reported using the RSS widget, but I suspect the same issue will occur with other commands that rely on ambiguous arguments.
My suspicion is that when CLI makes the SSH connection to the specified server, it is not passing the value of
WP_CLI_STRICT_ARGS_MODE
if set, but I have not investigated this.I have included other information that may be useful to debug, here: https://gist.github.com/paulgibbs/a90e68501cd7e735aef08a5a32945c76
The text was updated successfully, but these errors were encountered: