Collections functions
Encryption functions
General 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 4292 to 4332

Definition

 
function get_field($field)
    {
    
$field_escaped escape_check($field);
    
$r sql_query("
        SELECT ref,
               name,
               title,
               type,
               order_by,
               keywords_index,
               partial_index,
               resource_type,
               resource_column,
               display_field,
               use_for_similar,
               iptc_equiv,
               display_template,
               tab_name,
               required,
               smart_theme_name,
               exiftool_field,
               advanced_search,
               simple_search,
               help_text,
               display_as_dropdown,
               automatic_nodes_ordering
          FROM resource_type_field
         WHERE ref = '
{$field_escaped}'
     "
"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 16th July 2020 00:35 Europe/London time based on the source file dated 15th July 2020 16:26 Europe/London time.