customs
5 months ago
holders
5 months ago
checkbox.php
5 months ago
color-and-opacity.php
5 months ago
color.php
5 months ago
datepicker-range.php
5 months ago
dropdown-and-colors.php
5 months ago
dropdown.php
5 months ago
font.php
5 months ago
google-font.php
5 months ago
gradient.php
5 months ago
hidden.php
5 months ago
index.php
5 months ago
integer.php
5 months ago
list.php
5 months ago
multiple-textbox.php
5 months ago
paddings-editor.php
5 months ago
pattern.php
5 months ago
radio-colors.php
5 months ago
radio.php
5 months ago
textarea.php
5 months ago
textbox.php
5 months ago
url.php
5 months ago
wp-editor.php
5 months ago
url.php
41 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Url Control |
| 5 | * |
| 6 | * Main options: |
| 7 | * |
| 8 | * @see FactoryForms600_TextboxControl |
| 9 | * |
| 10 | * @package factory-forms |
| 11 | * @since 1.0.0 |
| 12 | */ |
| 13 | |
| 14 | // Exit if accessed directly |
| 15 | if ( ! defined( 'ABSPATH' ) ) { |
| 16 | exit; |
| 17 | } |
| 18 | |
| 19 | if ( ! class_exists( 'Wbcr_FactoryForms600_UrlControl' ) ) { |
| 20 | |
| 21 | class Wbcr_FactoryForms600_UrlControl extends Wbcr_FactoryForms600_TextboxControl { |
| 22 | |
| 23 | public $type = 'url'; |
| 24 | |
| 25 | /** |
| 26 | * Adding 'http://' to the url if it was missed. |
| 27 | * |
| 28 | * @since 1.0.0 |
| 29 | * @return string |
| 30 | */ |
| 31 | public function getSubmitValue( $name, $sub_name ) { |
| 32 | $value = parent::getSubmitValue( $name, $sub_name ); |
| 33 | if ( ! empty( $value ) && substr( $value, 0, 4 ) != 'http' ) { |
| 34 | $value = 'http://' . $value; |
| 35 | } |
| 36 | |
| 37 | return $value; |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 |