Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

append_field_value()

Parameters

ColumnTypeDefaultDescription
$field_data
$new_value
$existing_value

Location

include/resource_functions.php lines 1927 to 1946

Definition

 
function append_field_value($field_data,$new_value,$existing_value)
    {
    if (
$field_data["type"]!=&& $field_data["type"]!=&& $field_data["type"]!=&& $field_data["type"]!=12 && substr($new_value,0,1)!=",")
        {
        
# Automatically append a space when appending text types.
        
$val=$existing_value " " $new_value;
        }
    else
        {
        
# Verify a comma exists at the beginning of the value
        
if(substr($new_value,0,1)!=",")
            {
            
$new_value=",".$new_value;
            }
        
        
$val=(trim($existing_value)!=","?$existing_value:"") . $new_value;
        
        }
    return 
$val;
    }

This article was last updated 23rd November 2020 16:35 Europe/London time based on the source file dated 13th November 2020 16:50 Europe/London time.