Created
March 21, 2026 06:49
-
-
Save wplit/634a38bbaf811bc79a30664149b34498 to your computer and use it in GitHub Desktop.
test nestable element
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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