Version: 1.11.1.1
When construct or init in element class are used, settings in fronted are not loaded.
Constructor in code:
Frontend:
No constructor in code:
Frontend:
Same when init is used.
Version: 1.11.1.1
When construct or init in element class are used, settings in fronted are not loaded.
Constructor in code:
Frontend:
No constructor in code:
Frontend:
Same when init is used.
Hi.
What is the reason/what you want to achieve, when you use construct? I believe you are creating new element, right?
In this specific case I want to use hook for Bricks element.
add_action(âwoocommerce_before_add_to_cart_buttonâ, [$this, ârender_above_cartâ]);
If itâs not allowed to use constructor or init âby designâ, it would be nice to have it mentioned in documentation. Because it took me half a day to understand that Iâm not a camel, and itâs problem in Bricks, not in my constructor.
Can you try with a constructor like this:
public function __construct($element = null)
{
parent::__construct($element);
}
I guess that should run.
Yes, this way it works.
Please, add it to the element creation documentation here: Create Your Own Elements â Bricks Academy