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

remove_node_keyword_mappings()

Description

Function used to un-index node keywords

have access to the fields' data

Parameters

ColumnTypeDefaultDescription
$node array Individual node for a field ( as returned by get_nodes() )
$partial_index boolean|null false Partially index flag for node keywords. Use NULL if code doesn't

Return

boolean

Location

include/node_functions.php lines 1240 to 1280

Definition

 
function remove_node_keyword_mappings(array $node$partial_index false)
    {
    if(
'' == trim($node['ref']) && '' == trim($node['name']) && '' == trim($node['resource_type_field']))
        {
        return 
false;
        }

    
// Client code does not know whether field is partially indexed or not
    
if(is_null($partial_index))
        {
        
$field_data get_field($node['resource_type_field']);

        if(isset(
$field_data['partial_index']) && '' != trim($field_data['partial_index']))
            {
            
$partial_index $field_data['partial_index'];
            }
        }

    
$keywords split_keywords($node['name'], true$partial_index);
    
add_verbatim_keywords($keywords$node['name'], $node['resource_type_field']);

    for(
$n 0$n count($keywords); $n++)
        {
        unset(
$keyword_position);

        if(
is_array($keywords[$n]))
            {
            
$keyword_position $keywords[$n]['position'];
            
$keywords[$n]     = $keywords[$n]['keyword'];
            }

        if(!isset(
$keyword_position))
            {
            
$keyword_position $n;
            }

        
remove_node_keyword($node['ref'], $keywords[$n], $keyword_position);
        }

    return 
true;
    }

This article was last updated 19th March 2024 02:35 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.