_comment.php
2 years ago
_db.php
2 years ago
_hidden.php
2 years ago
_label.php
2 years ago
_row.php
2 years ago
attachment.php
2 years ago
checkbox.php
2 years ago
cleditor.php
2 years ago
codemirror.php
2 years ago
color.php
2 years ago
currency.php
2 years ago
date.php
2 years ago
datetime.php
2 years ago
email.php
2 years ago
link.php
2 years ago
number.php
2 years ago
oembed.php
2 years ago
password.php
2 years ago
phone.php
2 years ago
radio.php
2 years ago
select.php
2 years ago
slider.php
2 years ago
slug.php
2 years ago
text.php
2 years ago
textarea.php
2 years ago
time.php
2 years ago
tinymce.php
2 years ago
website.php
2 years ago
slug.php
27 lines
| 1 | <?php |
| 2 | // Don't load directly. |
| 3 | if ( ! defined( 'ABSPATH' ) ) { |
| 4 | die( '-1' ); |
| 5 | } |
| 6 | |
| 7 | $attributes = array(); |
| 8 | $attributes['type'] = 'text'; |
| 9 | $attributes['value'] = $value; |
| 10 | $attributes['tabindex'] = 2; |
| 11 | $attributes = PodsForm::merge_attributes( $attributes, $name, $form_field_type, $options ); |
| 12 | ?> |
| 13 | <input<?php PodsForm::attributes( $attributes, $name, $form_field_type, $options ); ?> /> |
| 14 | <script> |
| 15 | jQuery( function ( $ ) { |
| 16 | $( 'input#<?php echo esc_js( $attributes['id'] ); ?>' ).on( 'change', function () { |
| 17 | var newval = $( this ) |
| 18 | .val() |
| 19 | .toLowerCase() |
| 20 | .replace( /([_ ])/g, '-' ) |
| 21 | .replace( /([`~!@#$%^&*()_|+=?;:'",.<>\{\}\[\]\\\/])/g, '' ) |
| 22 | .replace( /(-){2,}/g, '-' ); |
| 23 | $( this ).val( newval ); |
| 24 | } ); |
| 25 | } ); |
| 26 | </script> |
| 27 |