Is there a way to hide the webform core pre-bulit lists without patching the core?

Currently I re-define the _webform_options_info and remove the corresponding core definition. It works, but only up till the next webform update. Is there a better way?

Comments

DanChadwick’s picture

Status: Active » Fixed

Yes. You're doing it wrong.

In webform.api.php, read the docblock for hook_webform_select_options_info(). Then implement it to tell webform about the custom lists you are providing, then implement the callbacks for each custom list.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

LBiStockholm’s picture

In the doc it says "This hook provides additional lists that may be utilized". I want to remove the native lists.

But - your answer led me further to hook_webform_select_options_info_alter where I found

function hook_webform_select_options_info_alter(&$items) {
// Remove the days of the week options.
unset($items['days']);
}

..which was exactly what I needed. Thanks!