It’s been a long time since I wrote a WordPress plugin but I’m getting back into it. I’m also pretty new to Bricks.
I’ve got the plugin installed and activated locally. It is showing my element in the builder UI in the section I specified. The controls are showing up when I add the element to my page and select it in the structure pane.
Here are my problems:
The defaults I have set in the controls are not showing in the bricks builder. For example, I have this checkbox control which is supposed to be true/on by default but the UI shows it as false/off.
I’m not sure where I’m going wrong, but the preview of my element won’t show anything, even if all I’m doing in the render function is returning $this->render_element_placeholder. Inspecting the page shows that other installed elements have a brxe-[name] class on the container, mine doesn’t have that either. I’m not sure why my render function doesn’t seem to be getting called.
I’d appreciate if anyone could shed some light on what’s happening for both or either of these.
I can’t believe how stupid I was. This whole time I’ve had it written as $this->set_attributes versus $this->set_attribute.
Thank you for setting me straight.
Unfortunately the defaults still aren’t showing correctly in the element controls (but seem to be taking affect in the preview regardless). In my case it isn’t just the checkboxes, it’s number inputs as well as selects and colors.