| Server IP : 95.171.21.124 / Your IP : 216.73.216.71 Web Server : Apache/2.4.66 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 System : Linux tr.turqaestate.com 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64 User : turqa ( 1005) PHP Version : 8.3.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/turqa/web/turqaestate.com/public_html/wp-content/plugins/cyr2lat/assets/js/ |
Upload File : |
/* global acf, CyrToLatAcfFieldGroup */
/**
* ACF support.
*
* @param {window.jQuery} $ jQuery.
* @param {Window} window Window.
* @param {document} document
* @package
*/
( function( $, window, document ) {
'use strict';
const table = CyrToLatAcfFieldGroup.table;
const convert = function( str ) {
$.each(
table,
function( k, v ) {
const regex = new RegExp( k, 'g' );
str = str.replace( regex, v );
}
);
str = str.replace( /[^\w\d\-_]/g, '' );
str = str.replace( /_+/g, '_' );
str = str.replace( /^_?(.*)$/g, '$1' );
str = str.replace( /^(.*)_$/g, '$1' );
return str;
};
acf.addFilter(
'generate_field_object_name',
function( val ) {
return convert( val );
}
);
$( document ).on(
'change',
'.acf-field .field-name',
function() {
if ( $( this ).is( ':focus' ) ) {
return false;
}
const $this = $( this );
let str = $this.val();
str = convert( str );
if ( str !== $this.val() ) {
$this.val( str );
}
}
);
}( window.jQuery, window, document ) );