Last active
November 12, 2021 05:46
-
-
Save BoDonkey/ce3775adf6d9764a3931b9cb8e3f1083 to your computer and use it in GitHub Desktop.
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 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