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 5319 to 5337

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 12th December 2024 12:35 Europe/London time based on the source file dated 12th December 2024 10:55 Europe/London time.