wp-shortcake / shortcake

Shortcake makes using WordPress shortcodes a piece of cake.
GNU General Public License v2.0
665 stars 143 forks source link

Term Select: Unable to remove term only replace #758

Closed grappler closed 6 years ago

grappler commented 6 years ago

When using term_select with 'multiple' => false, there is no option to remove the selected term just to override it.

When using 'multiple' => true, it is possible to remove the term but the value is then defined as null.

It would be good to be able to select "All terms".

This may apply to post_select too.

goldenapples commented 6 years ago

I was able to replicate. I think we should add a check in Shortcode.formatShortcode() to ensure that if a value is null, that attribute doesn't get output. Would that fix the issue?

It would be good to be able to select "All terms".

I've been thinking this over and I have a few questions:

grappler commented 6 years ago

if a value is null, that attribute doesn't get output. Would that fix the issue?

Yes, this would fix it when multiple is enabled.

Removing the selection is only possible when multiple is enabled. It would work for me too just to have a blank option where nothing is selected.