PluginProbe ʕ •ᴥ•ʔ
Disable Admin Notices – Hide Dashboard Notifications / trunk
Disable Admin Notices – Hide Dashboard Notifications vtrunk
1.4.5 trunk 1.0.0 1.0.2 1.0.3 1.0.5 1.0.6 1.1.1 1.1.3 1.1.4 1.2.0 1.2.2 1.2.3 1.2.4 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4
disable-admin-notices / libs / factory / forms / controls / url.php
disable-admin-notices / libs / factory / forms / controls Last commit date
customs 1 year ago holders 1 year ago checkbox.php 1 year ago color-and-opacity.php 1 year ago color.php 1 year ago datepicker-range.php 1 year ago dropdown-and-colors.php 1 year ago dropdown.php 1 year ago font.php 1 year ago google-font.php 1 year ago gradient.php 1 year ago hidden.php 1 year ago index.php 3 years ago integer.php 1 year ago list.php 1 year ago multiple-textbox.php 1 year ago paddings-editor.php 1 year ago pattern.php 1 year ago radio-colors.php 1 year ago radio.php 1 year ago textarea.php 1 year ago textbox.php 1 year ago url.php 1 year ago wp-editor.php 1 year ago
url.php
44 lines
1 <?php
2
3 /**
4 * Url Control
5 *
6 * Main options:
7 * @see FactoryForms480_TextboxControl
8 *
9 * @author Alex Kovalev <alex.kovalevv@gmail.com>
10 * @copyright (c) 2018, Webcraftic Ltd
11 *
12 * @package factory-forms
13 * @since 1.0.0
14 */
15
16 // Exit if accessed directly
17 if( !defined('ABSPATH') ) {
18 exit;
19 }
20
21 if( !class_exists('Wbcr_FactoryForms480_UrlControl') ) {
22
23 class Wbcr_FactoryForms480_UrlControl extends Wbcr_FactoryForms480_TextboxControl {
24
25 public $type = 'url';
26
27 /**
28 * Adding 'http://' to the url if it was missed.
29 *
30 * @since 1.0.0
31 * @return string
32 */
33 public function getSubmitValue($name, $sub_name)
34 {
35 $value = parent::getSubmitValue($name, $sub_name);
36 if( !empty($value) && substr($value, 0, 4) != 'http' ) {
37 $value = 'http://' . $value;
38 }
39
40 return $value;
41 }
42 }
43 }
44