PluginProbe
Themify Builder / 7.7.7
Themify Builder v7.7.7
7.8.1 7.8.0 7.7.9 7.7.8 7.7.7 7.7.6 7.7.5 7.7.4 7.7.3 7.7.2 trunk 7.6.0 7.6.1 7.6.2 7.6.3 7.6.4 7.6.5 7.6.6 7.6.7 7.6.8 7.6.9 7.7.0 7.7.1
themify-builder / modules / module-fancy-heading.php

module-fancy-heading.php in Themify Builder 7.7.7, at modules/module-fancy-heading.php

56 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined('ABSPATH') || exit;
3
4 /**
5 * Module Name: Fancy Heading
6 * Description: Heading with fancy styles
7 */
8 class TB_Fancy_Heading_Module extends Themify_Builder_Component_Module {
9
10
11 public static function get_module_name():string {
12 return __('Fancy Heading', 'themify');
13 }
14
15 public static function get_module_icon():string {
16 return 'smallcap';
17 }
18
19 public static function get_js_css():array {
20 return array(
21 'css' => 1
22 );
23 }
24
25
26 /**
27 * Render plain content for static content.
28 *
29 * @param array $module
30 * @return string
31 */
32 public static function get_static_content(array $module):string {
33 $mod_settings = $module['mod_settings']+array(
34 'heading' => '',
35 'heading_tag' => 'h1',
36 'sub_heading' => ''
37 );
38 $mod_settings['heading_tag'] = themify_whitelist_tag( $mod_settings['heading_tag'], 'h1' );
39 return sprintf('<%s>%s<br/>%s</%s>', $mod_settings['heading_tag'], $mod_settings['heading'], $mod_settings['sub_heading'], $mod_settings['heading_tag']);
40 }
41
42 public static function get_styling_image_fields() : array {
43 return [
44 'background_image' => ''
45 ];
46 }
47
48 public static function get_translatable_text_fields( $module ) : array {
49 return [ 'heading', 'sub_heading' ];
50 }
51
52 public static function get_translatable_link_fields( $module ) : array {
53 return [ 'heading_link', 'sub_heading_link', 'image' ];
54 }
55 }
56