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