control-type-animation.php
4 years ago
control-type-background.php
2 years ago
control-type-border.php
2 years ago
control-type-box-shadow.php
4 years ago
control-type-choose.php
4 years ago
control-type-code.php
4 years ago
control-type-color.php
4 years ago
control-type-date-time.php
1 year ago
control-type-dimensions.php
4 years ago
control-type-font.php
4 years ago
control-type-gallery.php
4 years ago
control-type-hover.php
4 years ago
control-type-icons.php
4 years ago
control-type-image-dimensions.php
4 years ago
control-type-image-size.php
4 years ago
control-type-input.php
4 years ago
control-type-media.php
4 years ago
control-type-number.php
4 years ago
control-type-select.php
4 years ago
control-type-select2.php
4 years ago
control-type-slider.php
4 years ago
control-type-switch.php
4 years ago
control-type-text-area.php
4 years ago
control-type-text-shadow.php
4 years ago
control-type-typography.php
4 years ago
control-type-url.php
4 years ago
control-type-wys.php
4 years ago
ct-base.php
4 years ago
ct-contract.php
4 years ago
ct-factory.php
4 years ago
widget-writer.php
3 weeks ago
control-type-typography.php
50 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ElementsKit_Lite\Modules\Widget_Builder\Controls; |
| 4 | |
| 5 | defined( 'ABSPATH' ) || exit; |
| 6 | |
| 7 | class Control_Type_Typography extends CT_Base { |
| 8 | |
| 9 | |
| 10 | public function start_writing_conf( $file_handler, $conf ) { |
| 11 | |
| 12 | $ret = ''; |
| 13 | |
| 14 | if ( ! empty( $conf->label ) ) { |
| 15 | $ret .= "\t\t\t\t" . '\'label\' => esc_html( \'' . esc_html( $conf->label ) . '\', \'elementskit\' ),' . PHP_EOL; |
| 16 | } |
| 17 | |
| 18 | if ( ! empty( $conf->selector ) ) { |
| 19 | $selectorProperty = str_replace( ',', ', {{WRAPPER}} ', esc_html( $conf->selector ) ); |
| 20 | $ret .= "\t\t\t\t" . '\'selector\' => \'{{WRAPPER}} ' . $selectorProperty . '\',' . PHP_EOL; |
| 21 | } |
| 22 | |
| 23 | if ( isset( $conf->show_label ) || isset( $conf->label_block ) || ! empty( $conf->separator ) || ! empty( $conf->classes ) ) : |
| 24 | $ret .= "\t\t\t\t'fields_options' => ["; |
| 25 | $ret .= "\n\t\t\t\t\t'typography' => ["; |
| 26 | |
| 27 | if ( isset( $conf->show_label ) ) { |
| 28 | $ret .= "\n\t\t\t\t\t\t'show_label' => " . ( $conf->show_label == 1 ? 'true' : 'false' ) . ','; |
| 29 | } |
| 30 | |
| 31 | if ( isset( $conf->label_block ) ) { |
| 32 | $ret .= "\n\t\t\t\t\t\t'label_block' => " . ( $conf->label_block == 1 ? 'true' : 'false' ) . ','; |
| 33 | } |
| 34 | |
| 35 | if ( ! empty( $conf->separator ) ) { |
| 36 | $ret .= "\n\t\t\t\t\t\t'separator' => '" . esc_html( $conf->separator ) . "',"; |
| 37 | } |
| 38 | |
| 39 | if ( ! empty( $conf->classes ) ) { |
| 40 | $ret .= "\n\t\t\t\t\t\t'classes' => '" . esc_html( $conf->classes ) . "',"; |
| 41 | } |
| 42 | |
| 43 | $ret .= "\n\t\t\t\t\t],"; |
| 44 | $ret .= "\n\t\t\t\t],\n"; |
| 45 | endif; |
| 46 | |
| 47 | return $ret; |
| 48 | } |
| 49 | } |
| 50 |