Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a RSS widget does not set the feed URL #1222

Closed
avaly opened this issue May 25, 2014 · 4 comments
Closed

Adding a RSS widget does not set the feed URL #1222

avaly opened this issue May 25, 2014 · 4 comments
Assignees
Milestone

Comments

@avaly
Copy link

avaly commented May 25, 2014

Adding a RSS widget to a sidebar will not populate the feed URL for that widget.

$ wp widget add rss sidebar-1 1 --url="http://www.smashingmagazine.com/feed/" --items=3
Success: Added widget to sidebar.

Actual result: widget is added with the number of items set to 3, but with empty feed URL.

Expected result: widget has the feed URL set.

wp-cli version 0.15.1.

@westonruter
Copy link
Contributor

Right, so this is probably because the --url param is ambiguous, referring either to the global WP-CLI --url parameter which sets the HTTP_HOST, instead of the widget instance item url. It would probably be better to prefix all such instance arguments with something like instance_ or to require passing JSON when setting the instance.

@danielbachhuber
Copy link
Member

Sorry about that @avaly. I've been waiting for this to come up. wp menu is subject to a similar problem:

// protected `url` param in WP-CLI

In short, any of the global arguments (e.g. --url, --path) aren't really accessible to subcommands. While it hasn't posed too much of a problem to date, it has the potential of becoming a more substantial issue as we continue forward.

I'm not a fan of requiring a instance_ prefix, but I don't have a better solution to propose at this point. I'll give it some thought.

@JonathanReeve
Copy link

I was directed here from this StackOverflow question where I'm trying to add an RSS widget using the --url flag, unsuccessfully. Is there a workaround for this?

@danielbachhuber
Copy link
Member

Is there a workaround for this?

No workarounds, unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants