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

get_field()

Description

A standard field title is translated using $lang. A custom field title is i18n translated.

Parameters

ColumnTypeDefaultDescription
$field integer Resource type field ID

Return

boolean|array Returns FALSE or record data (array)

Location

include/resource_functions.php lines 5164 to 5182

Definition

 
function get_field($field)
    {
    
$r ps_query("
        SELECT " 
columns_in("resource_type_field") . "
          FROM resource_type_field
         WHERE ref = ?
     "
, ['i'$field], "schema");

    
# Translates the field title if the searched field is found.
    
if(== count($r))
        {
        return 
false;
        }
    else
        {
        
$r[0]["title"] = lang_or_i18n_get_translated($r[0]["title"], "fieldtitle-");
        return 
$r[0];
        }
    }

This article was last updated 19th March 2024 09:35 Europe/London time based on the source file dated 11th March 2024 14:25 Europe/London time.