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

delete_node()

Description

Delete node. This will fully delete a node and remove any association between the deleted node and resources / keywords.

Parameters

ColumnTypeDefaultDescription
$ref integer ID of the node

Return

void

Location

include/node_functions.php lines 187 to 213

Definition

 
function delete_node($ref)
    {
    if(
is_parent_node($ref))
        {
        return;
        }

    
$returned_node = array();
    
get_node($ref$returned_nodefalse);
    if (empty(
$returned_node))
        {
        
// Node has already been removed.
        
return;
        }
    
$resource_type_field $returned_node['resource_type_field'];
    
$field_data get_resource_type_field($resource_type_field);

    global 
$FIXED_LIST_FIELD_TYPES;
    if (
in_array($field_data['type'], $FIXED_LIST_FIELD_TYPES))
        {
        
log_activity("Delete metadata field option for field {$resource_type_field}"LOG_CODE_DELETEDnull'node''name'$refnull$returned_node['name']);
        }

    
ps_query("DELETE FROM node WHERE ref = ?",array("i",$ref));
    
delete_node_resources($ref);
    
remove_all_node_keyword_mappings($ref);
    }

This article was last updated 22nd May 2024 15:35 Europe/London time based on the source file dated 14th May 2024 18:25 Europe/London time.