carbon-fields icon indicating copy to clipboard operation
carbon-fields copied to clipboard

Runtime loading value of html field

Open LaetitiaDall opened this issue 7 years ago • 1 comments

Version

  • Carbon Fields: 3
  • WordPress: 5.2
  • PHP: 7.2

Expected Behavior

When using a Callable with HTML field, it should be run at runtime like set_options of select.

Actual Behavior

The callable is called immediately, causing multiple issues like some post_type not being registered, or meta values unavailable at current time.

Container definition

    $fields[] = Field::make('html', $prefix . 'example', __('Event', 'dallinge'))
        ->set_html('callback');

LaetitiaDall avatar Jul 09 '19 21:07 LaetitiaDall

Fixed in https://github.com/htmlburger/carbon-fields/pull/845

jorostoyanov avatar Nov 04 '20 15:11 jorostoyanov