wpcli commands don't allow setting empty value
The wpcli integration allows us to set individual options, but doesn't allow setting them to falsey values.
For example, setting
baseHREFto an empty string or any of the boolean options to zero results in an error of "Missing required argument: <value>", which I've traced to the use of
After debugging it a bit, it seems that if an argument for the value is provided, it comes through (albeit in these cases as a zero length string or literal string zero character)...and if one is not provided, it comes through as NULL.
I propose that this should use an explicit null equality check instead of the
empty function, eg:
NULL === $value
- 1 replies
- Leon Stafford @leonstafford2020-03-24 23:10:12.913Z
In the current V6, which it seems you're using, there is also an
unsetcommand in WP-CLI for WP2Static (this was code contributed by a user who faced similar issues a cpl years back).
In V7, it should default to setting an empty string, or perhaps you can try setting
I recommend starting to use the V7 pre-releases, which offer a lot of improvements. Documentation is lacking though, so may need a bit of trial and error:https://github.com/WP2Static/wp2static/releases