Skip to content

Instantly share code, notes, and snippets.

@BoDonkey
Last active November 12, 2021 05:46
Show Gist options
  • Save BoDonkey/ce3775adf6d9764a3931b9cb8e3f1083 to your computer and use it in GitHub Desktop.
Save BoDonkey/ce3775adf6d9764a3931b9cb8e3f1083 to your computer and use it in GitHub Desktop.
<?php
class ADNA_HelloWorld extends ET_Builder_Module {
public $slug = 'adna_hello_world';
public $vb_support = 'on';
protected $module_credits = array(
'module_uri' => '',
'author' => '',
'author_uri' => '',
);
function init() {
$this->name = esc_html__( 'Hello World', 'adna-adnan' );
$this->settings_modal_toggles = array(
// Content tab's slug is "general"
'general' => array(
'toggles' => array(
'main_content' => esc_html__( 'Text', 'cotm-content-toggle-module' ),
),
),
);
}
public function get_fields() {
return array(
'content' => array(
'label' => esc_html__( 'Content', 'adna-adnan' ),
'type' => 'tiny_mce',
'option_category' => 'basic_option',
'description' => esc_html__( 'Content entered here will appear inside the module.', 'adna-adnan' ),
'toggle_slug' => 'main_content',
),
);
}
public function render( $attrs, $content = null, $render_slug ) {
$the_content = $this->props['content'];
return sprintf( '<h1>%1$s</h1>', $the_content );
}
}
new ADNA_HelloWorld;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment