Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

append_field_value()

Parameters

ColumnTypeDefaultDescription
$field_data
$new_value
$existing_value

Location

include/resource_functions.php lines 2018 to 2037

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 28th June 2022 15:05 Europe/London time based on the source file dated 27th June 2022 12:50 Europe/London time.