Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

get_featured_collection_ref_by_name()

Description

Find existing featured collection ref using its name and parent

Parameters

ColumnTypeDefaultDescription
$name string Featured collection name to search by
$parent null|integer The featured collection parent

Return

null|integer

Location

include/collections_functions.php lines 5043 to 5061

Definition

 
function get_featured_collection_ref_by_name(string $name$parent)
    {
    if(!
is_null($parent) && !is_int($parent))
        {
        return 
null;
        }

    
$ref sql_value(
        
sprintf("SELECT ref AS `value` FROM collection WHERE `name` = '%s' AND `type` = '%s' AND parent %s",
            
escape_check(trim($name)),
            
COLLECTION_TYPE_FEATURED,
            
sql_is_null_or_eq_val((string) $parentis_null($parent))
        ), 
        
null,
        
"featured_collections"
    
);

    return (
is_null($ref) ? null : (int) $ref);
    }

This article was last updated 21st April 2021 17:35 Europe/London time based on the source file dated 19th April 2021 16:50 Europe/London time.