Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element data access in apply_filters( 'layotter/view/element' ) #43

Open
raphaelsramos opened this issue May 8, 2020 · 0 comments
Open

Comments

@raphaelsramos
Copy link

raphaelsramos commented May 8, 2020

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:

  1. 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 ]

get

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

get_frontend_view

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant