layotter
layotter copied to clipboard
Element data access in apply_filters( 'layotter/view/element' )
Hello Dennis,
thank you very much for the solution you've created.
I'm doing some tests with Layotter and, in one of them, I need to access the element's data, mainly the type data, but I saw that you don't pass any element data to the layotter/view/element filter.
With that in mind, I made 2 changes to the components/element.php file:
- in the get() function I added a new case 'data' that returns an array ['type' => $this->type, 'title' => $this->title, 'description' => $this->description, 'icon' => $this->icon, 'order' => $this->order ]

- in the get_frontend_view() function I added a $this->get('data') to apply_filters( 'layotter/view/element' )

As these additions did not change the function purpose, but only allow access to more data, I would like them to be added definitively.
Best regards,
Raphael Ramos