# comments-plus/trunk/libs/factory/forms/controls/url.php

Disable Comments &amp; Delete All Comments, version trunk. 44 lines.

- Page: https://pluginprobe.com/plugins/comments-plus/trunk/code/libs/factory/forms/controls/url.php
- Raw: https://pluginprobe.com/plugins/comments-plus/trunk/raw/libs/factory/forms/controls/url.php
- Modified: 2024-12-10T00:10:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/comments-plus/trunk/code/libs/factory/forms/controls/url.php#L10-L20`.

```php
<?php

	/**
	 * Url Control
	 *
	 * Main options:
	 * @see FactoryForms480_TextboxControl
	 *
	 * @author Alex Kovalev <alex.kovalevv@gmail.com>
	 * @copyright (c) 2018, Webcraftic Ltd
	 *
	 * @package factory-forms
	 * @since 1.0.0
	 */

	// Exit if accessed directly
	if( !defined('ABSPATH') ) {
		exit;
	}

	if( !class_exists('Wbcr_FactoryForms480_UrlControl') ) {

		class Wbcr_FactoryForms480_UrlControl extends Wbcr_FactoryForms480_TextboxControl {

			public $type = 'url';

			/**
			 * Adding 'http://' to the url if it was missed.
			 *
			 * @since 1.0.0
			 * @return string
			 */
			public function getSubmitValue($name, $sub_name)
			{
				$value = parent::getSubmitValue($name, $sub_name);
				if( !empty($value) && substr($value, 0, 4) != 'http' ) {
					$value = 'http://' . $value;
				}

				return $value;
			}
		}
	}

```
