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.
$this->controls['itemShowOverlay'] = array(
'tab' => 'content',
'group' => 'overlay',
'label' => esc_html__( 'Show overlay', 'me' ),
'type' => 'checkbox',
'inline' => true,
'small' => true,
'default' => true,
);
- 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 abrxe-[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.