Collections functions
Encryption functions
General functions
Theme permission 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 1924 to 1946

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 11th July 2020 21:05 Europe/London time based on the source file dated 10th July 2020 16:06 Europe/London time.