You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking at this code trying to understand how i can tell the $element type within my filter method implementation. Instead of applying a callback here I think it would be better to have an optional method on each element which would be defined as part of the form definition. The default of course would be 'div'.
class WP_Form_Decorator_HtmlTag extends WP_Form_Decorator {
// TODO: some sort of callback for context-aware attributespublicfunctionrender( WP_Form_Component$element ) {
$args = wp_parse_args(
$this->args,
array(
// apply_filters('wp_form_htmltag_default', 'div'),'tag' =>$element->get_htmltag_default(),
'attributes' => array(),
)
);
return$this->open_tag($args['tag'], $args['attributes']) . $this->component_view->render($element) . $this->close_tag($args['tag']);
}
```ruby
The text was updated successfully, but these errors were encountered:
Hey,
I've been looking at this code trying to understand how i can tell the $element type within my filter method implementation. Instead of applying a callback here I think it would be better to have an optional method on each element which would be defined as part of the form definition. The default of course would be 'div'.
The text was updated successfully, but these errors were encountered: