class ET_Builder_Module_Text extends ET_Builder_Module {
$this->name = et_builder_i18n( 'Text' );
$this->plural = esc_html__( 'Texts', 'et_builder' );
$this->slug = 'et_pb_text';
$this->vb_support = 'on';
$this->settings_modal_toggles = array(
'main_content' => et_builder_i18n( 'Text' ),
'title' => et_builder_i18n( 'Text' ),
'tabbed_subtoggles' => true,
'bb_icons_support' => true,
'icon' => 'numbered-list',
'title' => esc_html__( 'Heading Text', 'et_builder' ),
'tabbed_subtoggles' => true,
'title' => et_builder_i18n( 'Sizing' ),
$this->main_css_element = '%%order_class%%';
$this->advanced_fields = array(
'label' => et_builder_i18n( 'Text' ),
'line_height' => "{$this->main_css_element} p",
'color' => "{$this->main_css_element}.et_pb_text",
'default' => floatval( et_get_option( 'body_font_height', '1.7' ) ) . 'em',
'default' => absint( et_get_option( 'body_font_size', '14' ) ) . 'px',
'hide_text_align' => true,
'label' => et_builder_i18n( 'Link' ),
'main' => "{$this->main_css_element} a",
'color' => "{$this->main_css_element}.et_pb_text a",
'default' => absint( et_get_option( 'body_font_size', '14' ) ) . 'px',
'label' => esc_html__( 'Unordered List', 'et_builder' ),
'main' => "{$this->main_css_element} ul li",
'color' => "{$this->main_css_element}.et_pb_text ul li, {$this->main_css_element}.et_pb_text ol li > ul li",
'line_height' => "{$this->main_css_element} ul li",
'item_indent' => "{$this->main_css_element} ul",
'label' => esc_html__( 'Ordered List', 'et_builder' ),
'main' => "{$this->main_css_element} ol li",
'color' => "{$this->main_css_element}.et_pb_text ol li",
'line_height' => "{$this->main_css_element} ol li",
'item_indent' => "{$this->main_css_element} ol",
'label' => esc_html__( 'Blockquote', 'et_builder' ),
'main' => "{$this->main_css_element} blockquote",
'color' => "{$this->main_css_element}.et_pb_text blockquote",
'label' => esc_html__( 'Heading', 'et_builder' ),
'main' => "{$this->main_css_element} h1",
'default' => absint( et_get_option( 'body_header_size', '30' ) ) . 'px',
'toggle_slug' => 'header',
'label' => esc_html__( 'Heading 2', 'et_builder' ),
'main' => "{$this->main_css_element} h2",
'toggle_slug' => 'header',
'label' => esc_html__( 'Heading 3', 'et_builder' ),
'main' => "{$this->main_css_element} h3",
'toggle_slug' => 'header',
'label' => esc_html__( 'Heading 4', 'et_builder' ),
'main' => "{$this->main_css_element} h4",
'toggle_slug' => 'header',
'label' => esc_html__( 'Heading 5', 'et_builder' ),
'main' => "{$this->main_css_element} h5",
'toggle_slug' => 'header',
'label' => esc_html__( 'Heading 6', 'et_builder' ),
'main' => "{$this->main_css_element} h6",
'toggle_slug' => 'header',
'margin_padding' => array(
'use_background_layout' => true,
'text_orientation' => array(
'background_layout' => array(
// Don't add text-shadow fields since they already are via font-options
$this->help_videos = array(
'name' => esc_html__( 'An introduction to the Text module', 'et_builder' ),
'label' => et_builder_i18n( 'Body' ),
'option_category' => 'basic_option',
'description' => esc_html__( 'Here you can create the content that will be used within the module.', 'et_builder' ),
'toggle_slug' => 'main_content',
'dynamic_content' => 'text',
'mobile_options' => true,
'label' => esc_html__( 'Unordered List Style Type', 'et_builder' ),
'description' => esc_html__( 'This setting adjusts the shape of the bullet point that begins each list item.', 'et_builder' ),
'option_category' => 'configuration',
'disc' => et_builder_i18n( 'Disc' ),
'circle' => et_builder_i18n( 'Circle' ),
'square' => et_builder_i18n( 'Square' ),
'none' => et_builder_i18n( 'None' ),
'default_on_front' => '',
'tab_slug' => 'advanced',
'mobile_options' => true,
'label' => esc_html__( 'Unordered List Style Position', 'et_builder' ),
'description' => esc_html__( 'The bullet point that begins each list item can be placed either inside or outside the parent list wrapper. Placing list items inside will indent them further within the list.', 'et_builder' ),
'option_category' => 'configuration',
'outside' => et_builder_i18n( 'Outside' ),
'inside' => et_builder_i18n( 'Inside' ),
'default_on_front' => '',
'tab_slug' => 'advanced',
'mobile_options' => true,
'ul_item_indent' => array(
'label' => esc_html__( 'Unordered List Item Indent', 'et_builder' ),
'description' => esc_html__( 'Increasing indentation will push list items further towards the center of the text content, giving the list more visible separation from the the rest of the text.', 'et_builder' ),
'option_category' => 'configuration',
'tab_slug' => 'advanced',
'default_on_front' => '',
'allowed_units' => array( '%', 'em', 'rem', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ex', 'vh', 'vw' ),
'range_settings' => array(
'mobile_options' => true,
'label' => esc_html__( 'Ordered List Style Type', 'et_builder' ),
'description' => esc_html__( 'Here you can choose which types of characters are used to distinguish between each item in the ordered list.', 'et_builder' ),
'option_category' => 'configuration',
'armenian' => 'armenian',
'cjk-ideographic' => 'cjk-ideographic',
'decimal-leading-zero' => 'decimal-leading-zero',
'georgian' => 'georgian',
'hiragana' => 'hiragana',
'hiragana-iroha' => 'hiragana-iroha',
'katakana' => 'katakana',
'katakana-iroha' => 'katakana-iroha',
'lower-alpha' => 'lower-alpha',
'lower-greek' => 'lower-greek',
'lower-latin' => 'lower-latin',
'lower-roman' => 'lower-roman',
'upper-alpha' => 'upper-alpha',
'upper-greek' => 'upper-greek',
'upper-latin' => 'upper-latin',
'upper-roman' => 'upper-roman',
'default_on_front' => '',
'tab_slug' => 'advanced',
'mobile_options' => true,
'label' => esc_html__( 'Ordered List Style Position', 'et_builder' ),
'description' => esc_html__( 'The characters that begins each list item can be placed either inside or outside the parent list wrapper. Placing list items inside will indent them further within the list.', 'et_builder' ),
'option_category' => 'configuration',
'inside' => et_builder_i18n( 'Inside' ),
'outside' => et_builder_i18n( 'Outside' ),
'default_on_front' => '',
'tab_slug' => 'advanced',
'mobile_options' => true,
'ol_item_indent' => array(
'label' => esc_html__( 'Ordered List Item Indent', 'et_builder' ),
'description' => esc_html__( 'Increasing indentation will push list items further towards the center of the text content, giving the list more visible separation from the the rest of the text.', 'et_builder' ),
'option_category' => 'configuration',
'tab_slug' => 'advanced',
'default_on_front' => '',
'allowed_units' => array( '%', 'em', 'rem', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ex', 'vh', 'vw' ),
'range_settings' => array(
'mobile_options' => true,
'quote_border_weight' => array(
'label' => esc_html__( 'Blockquote Border Weight', 'et_builder' ),
'description' => esc_html__( 'Block quotes are given a border to separate them from normal text. You can increase or decrease the size of that border using this setting.', 'et_builder' ),
'option_category' => 'configuration',
'tab_slug' => 'advanced',
'default_on_front' => '',
'allowed_units' => array( 'em', 'rem', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ex', 'vh', 'vw' ),
'range_settings' => array(
'mobile_options' => true,
'quote_border_color' => array(
'label' => esc_html__( 'Blockquote Border Color', 'et_builder' ),
'description' => esc_html__( 'Block quotes are given a border to separate them from normal text. Pick a color to use for that border.', 'et_builder' ),
'option_category' => 'configuration',
'tab_slug' => 'advanced',
'field_template' => 'color',
'mobile_options' => true,
function convert_embeds( $matches ) {
if ( strpos( $url, '?v=' ) ) {
// e.g. https://www.youtube.com/watch?v=Wx6bTxiOmRc
$pieces = explode( 'v=', $url );
// e.g. https://youtu.be/UABdOJQ3pdo
$pieces = explode( '/', $url );
$video_id = end( $pieces );
'<p><iframe width="1080" height="608" src="%s" allow="%s" allowfullscreen></iframe></p>',
sprintf( 'https://www.youtube.com/embed/%s', esc_attr( $video_id ) ),
'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture'
* Transition fields for Text module.
* @return array Fields list in array.
public function get_transition_fields_css_props() {
$fields = parent::get_transition_fields_css_props();
$fields['quote_border_weight'] = array( 'border-width' => '%%order_class%% blockquote' );