Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

remove_keyword_mappings()

Parameters

ColumnTypeDefaultDescription
$ref
$string
$resource_type_field
$partial_index false
$is_date false
$optional_column ''
$optional_value ''
$is_html false

Location

include/resource_functions.php lines 2039 to 2061

Definition

 
function remove_keyword_mappings($ref,$string,$resource_type_field,$partial_index=false,$is_date=false,$optional_column='',$optional_value='',$is_html=false)
    {
    
# Removes one instance of each keyword->resource mapping for each occurrence of that
    # keyword in $string.
    # This is used to remove keyword mappings when a field has changed.
    # We also decrease the hit count for each keyword.
    
if (trim($string)=="") {return false;}
    
$keywords=split_keywords($string,true,$partial_index,$is_date,$is_html);

    
add_verbatim_keywords($keywords$string$resource_type_field);        // add in any verbatim keywords (found using regex).

    
for ($n=0;$n<count($keywords);$n++)
        {
        unset (
$kwpos);
        if (
is_array($keywords[$n])){
            
$kwpos=$keywords[$n]['position'];
            
$keywords[$n]=$keywords[$n]['keyword'];
        }        
        
$kw=$keywords[$n]; 
        if (!isset(
$kwpos)){$kwpos=$n;}
        
remove_keyword_from_resource($ref,$keywords[$n],$resource_type_field,$optional_column='',$optional_value='',false$kwpos);
        }    
    }

This article was last updated 28th June 2022 15:05 Europe/London time based on the source file dated 27th June 2022 12:50 Europe/London time.