Browser: Any
OS: Windows
In snippet:
add_filter( 'bricks/element/form/datepicker_options', function( $options, $element ) {
if ( $element->id === 'abcdef' ) {
// localize the form "abcdef" element
$options['locale'] = 'XX';
}
return $options;
}, 10, 2 );
Element check $element->id === 'abcdef' is not working with components. But works fine with form id from 'data-script-id' attribute.
Hi @Illarion ,
As a component could have different instances. You should error log out the $element->uid and check which one you want to target.
Regards,
Jenn
Hi @itchycode ,
Is there a way to get all instances of the component?
Nope, there is no helper function to get this.
When you are editing a component instance, you can click “Copy Bricks ID” via the right click context menu on the Structure panel and you should be able to get the full ID like ‘q1w2e3-p0o9i8’