is_field_displayed()

Description

Checks whether a specified field should be displayed based on various conditions.

This function evaluates several criteria to determine if a field is visible in the resource editing interface.
It takes into account the field's active status, permissions for viewing and editing, upload conditions,
and any custom hooks that may hide the field.

Parameters

ColumnTypeDefaultDescription
$field array The field configuration array containing information about the field's settings.

Return

bool Returns true if the field should be displayed; false otherwise.

Location

include/render_functions.php lines 1796 to 1812

Definition

 
function is_field_displayed($field)
    {
    global 
$ref$resource$upload_review_mode;

    
# Conditions under which the field is not displayed
    
return !(
        (
$field['active']==0)
        
# Field does not have individual write access allowed; and does not have edit access allowed on upload
        
|| (checkperm("F*") && !checkperm("F-" $field["ref"]) && !($ref && checkperm("P" $field["ref"])))
        
# Field has write access denied directly
        
|| checkperm("F" $field["ref"])
        
# Field is hidden on upload
        
|| (($ref || $upload_review_mode) && $field["hide_when_uploading"])
        
# Other field conditions
        
|| hook('edithidefield''', array('field' => $field))
        || 
hook('edithidefield2''', array('field' => $field)));
    }

This article was last updated 17th April 2025 21:35 Europe/London time based on the source file dated 17th April 2025 12:55 Europe/London time.