get_search_default_restypes()

Description

Retrieves the default resource types for search functionality.

This function determines which resource types to include in the search based on the global
settings for resource and theme inclusion. If resources are to be included, it checks the
default resource types and returns them as an array. If no specific default resource types
are defined, it defaults to including "Global." If resources are not to be included, it
defaults to "Collections," and if themes are included, "FeaturedCollections" is also added.

Parameters

This function accepts no parameters.

Return

array An array of default resource types to be used in the search.

Location

include/search_functions.php lines 3129 to 3147

Definition

 
function get_search_default_restypes()
{
    global 
$search_includes_resources$search_includes_themes,$default_res_types;
    
$defaultrestypes = array();

    if (
$search_includes_resources) {
        if (
$default_res_types == "") {
            
$defaultrestypes[] = "Global";
        } else {
            
$defaultrestypes = (is_array($default_res_types) ? $default_res_types explode(",", (string) $default_res_types));
        }
    } else {
        
$defaultrestypes[] = "Collections";
        if (
$search_includes_themes) {
            
$defaultrestypes[] = "FeaturedCollections";
        }
    }
    return 
$defaultrestypes;
}

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