kasparsd / widget-context-wporg

Widget Context for WordPress
https://widgetcontext.com
Other
42 stars 13 forks source link

"target by URL" field does not work if it contains a blank line #2

Closed thejamescollins closed 11 years ago

thejamescollins commented 11 years ago

If the "target by URL" field contains a blank line at the end of it, the widget won't display on any page at all.

Temporary workaround is to ensure there is no blank/new line at the end of the field.

Not very intuitive, so ideally this should be fixed.

kasparsd commented 11 years ago

Awesome! This is a very old bug.

My suggestion would be to use explode with array_filter, like so:

array_filter( explode("\n", (string) $vis_settings['url']['urls'] ) )
thejamescollins commented 11 years ago

Thanks @kasparsd. I'll take a look at this ASAP.

kasparsd commented 11 years ago

I just started reworking that part of the code, so give me a few minutes to push those.

thejamescollins commented 11 years ago

No problem - I won't be looking at this until next week I'd say.

kasparsd commented 11 years ago

Should be fixed with @7cdf060