Skip to content

Instantly share code, notes, and snippets.

View lots0logs's full-sized avatar
🧑‍💻

Dustin Falgout lots0logs

🧑‍💻
View GitHub Profile
@lots0logs
lots0logs / pseudo-code.php
Created April 18, 2018 21:48
Divi Builder :: Custom Module :: Declaring Full Compatibility
<?php
class MYEX_HelloWorld extends ET_Builder_Module {
public $slug = 'myex_hello_world';
public $vb_support = 'on';
public function init() {
$this->name = esc_html__( 'Hello World', 'myex-my-extension' );
}
@lots0logs
lots0logs / psuedo-code.php
Last active April 18, 2018 21:49
Divi Builder :: Custom Module :: Declaring Partial Compatibility
<?php
class MYEX_HelloWorld extends ET_Builder_Module {
public $slug = 'myex_hello_world';
public $vb_support = 'partial';
public function init() {
$this->name = esc_html__( 'Hello World', 'myex-my-extension' );
}
@lots0logs
lots0logs / docker-compose.yml
Created April 16, 2018 20:23
Divi Development Environment
version: '3.3'
services:
mariadb:
image: 'mariadb:10.2.14'
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress
DATADIR: /data
// Internal Dependencies
import SimpleHeader from './SimpleHeader/SimpleHeader';
export default [
SimpleHeader,
];
@lots0logs
lots0logs / pseudo-code.php
Created March 26, 2018 09:27
Custom CSS Fields Configuration Example
<?php
class SIMP_SimpleHeader extends ET_Builder_Module {
// ...Rest of implementation
public function get_custom_css_fields_config() {
return array(
'content' => array(
'label' => esc_html__( 'Content', 'simp-simple' ),
@lots0logs
lots0logs / pseudo-code.jsx
Last active March 26, 2018 08:55
Module Setting Default Value Example 2
class SimpleHeader extends Component {
// Example 1: Text orientation has been set to the non-default value 'right'
render() {
console.log(this.props.text_orientation); // Outputs: 'right'
}
// Example 2: Text orientation has been set to the default value 'left'
render() {
@lots0logs
lots0logs / pseudo-code.php
Created March 26, 2018 08:27
Module Setting Default Value Example
<?php
class SIMP_SimpleHeader extends ET_Builder_Module {
// ...Rest of implementation
public function get_fields() {
return array(
'text_orientation' => array(
'default' => 'left',
@lots0logs
lots0logs / pseudo-code.php
Created March 26, 2018 05:13
All Advanced Fields Configuration Examples
<?php
class SIMP_SimpleHeader extends ET_Builder_Module {
// Example 1: Include all advanced fields using their default configuartion
public function get_advanced_fields_config() {
return array();
}
// Example 2: Include all advanced fields using custom configuartions
@lots0logs
lots0logs / pseudo-code.php
Created March 25, 2018 13:03
Max Width Field Configuratin Examples
<?php
class SIMP_SimpleHeader extends ET_Builder_Module {
// Example 1: Include Max Width Field using its default configuartion
public function get_advanced_fields_config() {
return array();
}
// Example 2: Include Max Width Field using a custom configuartion
@lots0logs
lots0logs / pseudo-code.php
Created March 25, 2018 13:00
Margin & Padding Field Configuration Examples
<?php
class SIMP_SimpleHeader extends ET_Builder_Module {
// Example 1: Include Margin & Padding Field using its default configuartion
public function get_advanced_fields_config() {
return array();
}
// Example 2: Include Margin & Padding Field using a custom configuartion