Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test 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.