a name of the control * title => Заголовок * colors => массив цветов для градиента * Пример: array("#000 0% 0.5", "#e70303 100% 1") * filldirection => Направление градиента(top, left) * Пример: 90deg * value => a value to show in the control * default => a default value of the control if the "value" option is not specified * * @package core * @since 1.0.0 */ // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Wbcr_FactoryForms600_GradientControl' ) ) { class Wbcr_FactoryForms600_GradientControl extends Wbcr_FactoryForms600_Control { public $type = 'gradient'; /** * Shows the html markup of the control. * * @since 1.0.0 * @return void */ public function html() { $name = $this->getNameOnForm(); $value = esc_attr( $this->getValue() ); if ( ! empty( $value ) ) { $values = json_decode( stripcslashes( htmlspecialchars_decode( $value ) ) ); $points = ''; foreach ( $values->color_points as $split_values ) { $points .= $split_values . ','; } $points = rtrim( $points, ',' ); $this->addHtmlData( 'points', $points ); $this->addHtmlData( 'directions', $values->filldirection ); } else { $this->addHtmlData( 'directions', 'top' ); } ?>