Plugin Author
Tim W
(@timwhitlock)
It’s not possible to specify a plugin or theme other than by its text domain, which is expected to be unique by convention.
Your use case isn’t supported by the cli utility, but the equivalent sync function via the UI does support it. I suggest you use that instead.
Would it be possible to add this functionality to the CLI extract, fetch and sync command?
We have already successfully tested a possible integration, I think it would be great to be able to have the same use case covered by the cli utility instead only only supporting it through the UI.
Possible changes:
https://gist.github.com/raphaelportmann/191ea568edbf6bb46bc98f9485fcc25b
-
This reply was modified 6 months ago by
WEBKINDER.
-
This reply was modified 6 months ago by
WEBKINDER.
Plugin Author
Tim W
(@timwhitlock)
So you are proposing to use theme/foo
to avoid matching every bundle whose text domains is “foo”. Likewise plugin/foo/bar.php
. Is that correct?
Thats correct. It uses the theme/plugin handle (has to be unique) instead of a text-domain (should be unique but isn’t in our case). The way I propose to implement it there’s not really a problem with colliding handles and text-domains. So it shouldn’t break existing scripts using the CLI command with text-domains.
Or do you see a better way?
-
This reply was modified 5 months, 4 weeks ago by
WEBKINDER.
-
This reply was modified 5 months, 4 weeks ago by
WEBKINDER.
Plugin Author
Tim W
(@timwhitlock)
It’s a little esoteric, but should be ok.
The one thing I’d change is to use a syntax like theme:name to avoid it looking like a path, which it isn’t.
I wonder if the disambiguation is necessary for plugins as they should end with *.php (I think) e.g. loco-translate/loco.php is the handle for this plugin.
For sure, the “theme:handle” and “plugin:handle” format would definitely help to understand the syntax used to select a single theme or plugin.
Imo it’s also better to use the same syntax for themes and plugins, so it’s easier to understand and constistent when using the command.
-
This reply was modified 5 months, 4 weeks ago by
WEBKINDER.
Plugin Author
Tim W
(@timwhitlock)
Now supported on the Development branch
The syntax is themes:{slug}
or plugins:{handle}
to keep naming consistent with (themes|plugins|core) and act like an optional argument to the type. As a result the Core is filterable also, e.g. core:admin-network