Submit
Path:
~
/
home
/
getwphos
/
public_html
/
kingpanel
/
wp-content
/
plugins
/
gravityforms
/
includes
/
fields
/
File Content:
class-gf-field-website.php
<?php if ( ! class_exists( 'GFForms' ) ) { die(); } class GF_Field_Website extends GF_Field { public $type = 'website'; public function get_form_editor_field_title() { return esc_attr__( 'Website', 'gravityforms' ); } /** * Returns the field's form editor description. * * @since 2.5 * * @return string */ public function get_form_editor_field_description() { return esc_attr__( 'Allows users to enter a website URL.', 'gravityforms' ); } /** * Returns the field's form editor icon. * * This could be an icon url or a gform-icon class. * * @since 2.5 * * @return string */ public function get_form_editor_field_icon() { return 'gform-icon--link'; } function get_form_editor_field_settings() { return array( 'conditional_logic_field_setting', 'prepopulate_field_setting', 'error_message_setting', 'label_setting', 'label_placement_setting', 'admin_label_setting', 'size_setting', 'rules_setting', 'visibility_setting', 'duplicate_setting', 'default_value_setting', 'placeholder_setting', 'description_setting', 'css_class_setting', 'autocomplete_setting', ); } public function is_conditional_logic_supported() { return true; } public function validate( $value, $form ) { if ( empty( $value ) || in_array( $value, array( 'http://', 'https://' ) ) ) { $value = ''; if ( $this->isRequired ) { $this->failed_validation = true; $this->validation_message = empty( $this->errorMessage ) ? esc_html__( 'This field is required.', 'gravityforms' ) : $this->errorMessage; } } if ( ! empty( $value ) && ! GFCommon::is_valid_url( $value ) ) { $this->failed_validation = true; $this->validation_message = empty( $this->errorMessage ) ? esc_html__( 'Please enter a valid Website URL (e.g. https://gravityforms.com).', 'gravityforms' ) : $this->errorMessage; } } public function get_field_input( $form, $value = '', $entry = null ) { $is_entry_detail = $this->is_entry_detail(); $is_form_editor = $this->is_form_editor(); $form_id = $form['id']; $id = intval( $this->id ); $field_id = $is_entry_detail || $is_form_editor || $form_id == 0 ? "input_$id" : 'input_' . $form_id . "_$id"; $size = $this->size; $disabled_text = $is_form_editor ? "disabled='disabled'" : ''; $class_suffix = $is_entry_detail ? '_admin' : ''; $class = $size . $class_suffix; $class = esc_attr( $class ); $html_input_type = 'url'; $placeholder_attribute = $this->get_field_placeholder_attribute(); $required_attribute = $this->isRequired ? 'aria-required="true"' : ''; $invalid_attribute = $this->failed_validation ? 'aria-invalid="true"' : 'aria-invalid="false"'; $aria_describedby = $this->get_aria_describedby(); $autocomplete = $this->enableAutocomplete ? $this->get_field_autocomplete_attribute() : ''; $tabindex = $this->get_tabindex(); $value = esc_attr( $value ); $class = esc_attr( $class ); return "<div class='ginput_container ginput_container_website'> <input name='input_{$id}' id='{$field_id}' type='$html_input_type' value='{$value}' class='{$class}' {$tabindex} {$aria_describedby} {$disabled_text} {$placeholder_attribute} {$required_attribute} {$invalid_attribute} {$autocomplete}/> </div>"; } /** * Format the entry value for display on the entry detail page and for the {all_fields} merge tag. * * @since 1.9 * @since 2.9.29 Changed the second parameter $currency (string) to $entry (array). * * @param string|array $value The field value. * @param array $entry The entry. * @param bool|false $use_text When processing choice based fields should the choice text be returned instead of the value. * @param string $format The format requested for the location the merge is being used. Possible values: html, text or url. * @param string $media The location where the value will be displayed. Possible values: screen or email. * * @return string */ public function get_value_entry_detail( $value, $entry = array(), $use_text = false, $format = 'html', $media = 'screen' ) { $safe_value = esc_url( (string) $value ); return GFCommon::is_valid_url( $value ) && $format == 'html' ? "<a href='$safe_value' target='_blank'>$safe_value</a>" : $safe_value; } public function get_value_save_entry( $value, $form, $input_name, $lead_id, $lead ) { if ( empty( $value ) || in_array( $value, array( 'http://', 'https://' ) ) ) { return ''; } $value = filter_var( $value, FILTER_VALIDATE_URL ); return $value ? $value : ''; } // # FIELD FILTER UI HELPERS --------------------------------------------------------------------------------------- /** * Returns the filter operators for the current field. * * @since 2.4 * * @return array */ public function get_filter_operators() { $operators = parent::get_filter_operators(); $operators[] = 'contains'; return $operators; } /** * Performs actions after the field has been converted to an object. * * Ensures the `autocompleteAttribute` property is set to 'url' if it is not already defined. * * @since 2.9.8 * */ public function post_convert_field() { parent::post_convert_field(); if ( $this->is_form_editor() && empty( $this->autocompleteAttribute ) ) { $this->autocompleteAttribute = 'url'; } } } GF_Fields::register( new GF_Field_Website() );
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
field-decorator-choice
---
0755
class-gf-field-address.php
67606 bytes
0644
class-gf-field-calculation.php
8156 bytes
0644
class-gf-field-captcha.php
26506 bytes
0644
class-gf-field-checkbox.php
40632 bytes
0644
class-gf-field-consent.php
19235 bytes
0644
class-gf-field-creditcard.php
31192 bytes
0644
class-gf-field-date.php
53230 bytes
0644
class-gf-field-donation.php
3329 bytes
0644
class-gf-field-email.php
19180 bytes
0644
class-gf-field-fileupload.php
74801 bytes
0644
class-gf-field-hidden.php
3212 bytes
0644
class-gf-field-hiddenproduct.php
5251 bytes
0644
class-gf-field-honeypot.php
1367 bytes
0644
class-gf-field-html.php
3127 bytes
0644
class-gf-field-image-choice.php
7849 bytes
0644
class-gf-field-list.php
31546 bytes
0644
class-gf-field-multiple-choice.php
4817 bytes
0644
class-gf-field-multiselect.php
14324 bytes
0644
class-gf-field-name.php
33271 bytes
0644
class-gf-field-number.php
14531 bytes
0644
class-gf-field-option.php
1161 bytes
0644
class-gf-field-page.php
2010 bytes
0644
class-gf-field-password.php
19170 bytes
0644
class-gf-field-phone.php
10814 bytes
0644
class-gf-field-post-category.php
1303 bytes
0644
class-gf-field-post-content.php
1854 bytes
0644
class-gf-field-post-custom-field.php
2694 bytes
0644
class-gf-field-post-excerpt.php
5373 bytes
0644
class-gf-field-post-image.php
17541 bytes
0644
class-gf-field-post-tags.php
4007 bytes
0644
class-gf-field-post-title.php
3541 bytes
0644
class-gf-field-price.php
3279 bytes
0644
class-gf-field-product.php
1110 bytes
0644
class-gf-field-quantity.php
1156 bytes
0644
class-gf-field-radio.php
21266 bytes
0644
class-gf-field-repeater.php
33534 bytes
0644
class-gf-field-section.php
2656 bytes
0644
class-gf-field-select.php
8229 bytes
0644
class-gf-field-shipping.php
1074 bytes
0644
class-gf-field-singleproduct.php
10973 bytes
0644
class-gf-field-singleshipping.php
3268 bytes
0644
class-gf-field-submit.php
7147 bytes
0644
class-gf-field-text.php
9758 bytes
0644
class-gf-field-textarea.php
21950 bytes
0644
class-gf-field-time.php
19496 bytes
0644
class-gf-field-total.php
7097 bytes
0644
class-gf-field-website.php
5496 bytes
0644
class-gf-field.php
88308 bytes
0644
class-gf-fields.php
2584 bytes
0644
index.php
27 bytes
0644
N4ST4R_ID | Naxtarrr