name = esc_html__( 'Code', 'et_builder' ); $this->plural = esc_html__( 'Codes', 'et_builder' ); $this->slug = 'et_pb_code'; $this->vb_support = 'on'; $this->use_raw_content = true; $this->settings_modal_toggles = array( 'general' => array( 'toggles' => array( 'main_content' => et_builder_i18n( 'Text' ), ), ), 'advanced' => array( 'toggles' => array( 'width' => array( 'title' => et_builder_i18n( 'Sizing' ), 'priority' => 65, ), ), ), ); $this->advanced_fields = array( 'margin_padding' => array( 'css' => array( 'important' => array( 'custom_margin' ), // needed to overwrite last module margin-bottom styling ), ), 'text_shadow' => array( // Don't add text-shadow fields since they already are via font-options 'default' => false, ), 'fonts' => false, 'button' => false, ); $this->help_videos = array( array( 'id' => 'dTY6-Cbr00A', 'name' => esc_html__( 'An introduction to the Code module', 'et_builder' ), ), ); } function get_fields() { $fields = array( 'raw_content' => array( 'label' => esc_html__( 'Code', 'et_builder' ), 'type' => 'codemirror', 'mode' => 'html', 'option_category' => 'basic_option', 'description' => esc_html__( 'Here you can create the content that will be used within the module.', 'et_builder' ), 'is_fb_content' => true, 'toggle_slug' => 'main_content', 'mobile_options' => true, 'hover' => 'tabs', ), ); return $fields; } /** * Renders the module output. * * @param array $attrs List of attributes. * @param string $content Content being processed. * @param string $render_slug Slug of module that is used for rendering output. * * @return string */ public function render( $attrs, $content, $render_slug ) { $multi_view = et_pb_multi_view_options( $this ); $video_background = $this->video_background(); $parallax_image_background = $this->get_parallax_image_background(); // Module classnames $this->add_classname( $this->get_text_orientation_classname() ); $raw_content = $multi_view->render_element( array( 'tag' => 'div', 'content' => '{{raw_content}}', 'attrs' => array( 'class' => 'et_pb_code_inner', ), ) ); $output = sprintf( '