HEX
Server: Apache
System: Linux web5.visualcom.es 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: ensaco.es (10019)
PHP: 8.3.32
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/ensaco.es/httpdocs/wp-content/plugins/bb-plugin/includes/ui-field-ordering.php
<#

// Make sure we have an options array.
if ( '' === data.field.options ) {
	data.field.options = [];
}

// JSON parse if needed.
if ( '' !== data.value && 'string' === typeof data.value ) {
	data.value = JSON.parse( data.value );
}

// Set the default value if we do not have one.
if ( '' === data.value ) {
	data.value = Object.keys( data.field.options )[0];
}

// Make sure any new options are added to the value.
for ( var key in data.field.options ) {
	if ( jQuery.inArray( key, data.value ) === -1 ) {
		data.value.push( key );
	}
}

var encodedValue = JSON.stringify( data.value );

#>
<div class="fl-ordering-field-options<# if ( data.field.className ) { #> {{data.field.className}}<# } #>">
	<# for ( var i in data.value ) { #>
	<div class="fl-ordering-field-option" data-key="{{data.value[ i ]}}">{{data.field.options[ data.value[ i ] ]}}<i class="fas fa-arrows-alt"></i></div>
	<# } #>
</div>
<input type="hidden" name="{{data.name}}" value='{{{encodedValue}}}' />