Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test 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 4th December 2024 08:35 Europe/London time based on the source file dated 28th November 2024 12:10 Europe/London time.