Skip to content

Instantly share code, notes, and snippets.

@wplit
Created March 21, 2026 06:49
Show Gist options
  • Select an option

  • Save wplit/634a38bbaf811bc79a30664149b34498 to your computer and use it in GitHub Desktop.

Select an option

Save wplit/634a38bbaf811bc79a30664149b34498 to your computer and use it in GitHub Desktop.
test nestable element
<?php
class X_Test_Element extends \Bricks\Element {
// Element properties
public $category = "general";
public $name = "xtestelement";
public $icon = "ti-layout-width-full";
public function get_label() {
return esc_html__("Test element", "bricks");
}
public function set_controls() {
}
public function render() {
echo "<div {$this->render_attributes("_root")}>";
echo \Bricks\Frontend::render_children( $this );
echo "</div>";
}
public static function render_builder() { ?>
<script type="text/x-template" id="tmpl-bricks-element-xtestelement">
<component :is="div" class="product-title">
<bricks-element-children :element="element" />
</component>
</script>
<?php }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment