Collections functions
General functions
Render functions
Theme permission 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 4733 to 4751

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 2nd October 2022 03:35 Europe/London time based on the source file dated 30th September 2022 14:20 Europe/London time.