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

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 5327 to 5345

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 17th November 2024 15:35 Europe/London time based on the source file dated 15th November 2024 18:30 Europe/London time.