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-number.php
56 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ElementsKit_Lite\Modules\Widget_Builder\Controls; |
| 4 | |
| 5 | defined( 'ABSPATH' ) || exit; |
| 6 | |
| 7 | class Control_Type_Number extends CT_Base { |
| 8 | |
| 9 | public function start_writing_conf( $file_handler, $conf ) { |
| 10 | |
| 11 | $ret = ''; |
| 12 | |
| 13 | if ( ! empty( $conf->placeholder ) ) { |
| 14 | $ret .= "\t\t\t\t" . '\'placeholder\' => esc_html( \'' . esc_html( $conf->placeholder ) . '\' ),' . PHP_EOL; |
| 15 | } |
| 16 | |
| 17 | if ( ! empty( $conf->description ) ) { |
| 18 | $ret .= "\t\t\t\t" . '\'description\' => esc_html( \'' . esc_html( $conf->description ) . '\' ),' . PHP_EOL; |
| 19 | } |
| 20 | |
| 21 | if ( ! empty( $conf->default ) ) { |
| 22 | $ret .= "\t\t\t\t" . '\'default\' => esc_html( \'' . esc_html( $conf->default ) . '\' ),' . PHP_EOL; |
| 23 | } |
| 24 | |
| 25 | if ( ! empty( $conf->separator ) ) { |
| 26 | $ret .= "\t\t\t\t" . '\'separator\' => \'' . esc_html( $conf->separator ) . '\',' . PHP_EOL; |
| 27 | } |
| 28 | |
| 29 | if ( ! empty( $conf->classes ) ) { |
| 30 | $ret .= "\t\t\t\t" . '\'classes\' => \'' . esc_html( $conf->classes ) . '\',' . PHP_EOL; |
| 31 | } |
| 32 | |
| 33 | if ( ! empty( $conf->min ) ) { |
| 34 | $ret .= "\t\t\t\t" . '\'min\' => \'' . floatval( $conf->min ) . '\',' . PHP_EOL; |
| 35 | } |
| 36 | |
| 37 | if ( ! empty( $conf->max ) ) { |
| 38 | $ret .= "\t\t\t\t" . '\'max\' => \'' . floatval( $conf->max ) . '\',' . PHP_EOL; |
| 39 | } |
| 40 | |
| 41 | if ( ! empty( $conf->step ) ) { |
| 42 | $ret .= "\t\t\t\t" . '\'step\' => \'' . esc_html( $conf->step ) . '\',' . PHP_EOL; |
| 43 | } |
| 44 | |
| 45 | if ( isset( $conf->show_label ) ) { |
| 46 | $ret .= "\t\t\t\t" . '\'show_label\' => ' . ( $conf->show_label == 1 ? 'true' : 'false' ) . ',' . PHP_EOL; |
| 47 | } |
| 48 | |
| 49 | if ( isset( $conf->label_block ) ) { |
| 50 | $ret .= "\t\t\t\t" . '\'label_block\' => ' . ( $conf->label_block == 1 ? 'true' : 'false' ) . ',' . PHP_EOL; |
| 51 | } |
| 52 | |
| 53 | return $ret; |
| 54 | } |
| 55 | } |
| 56 |