Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

delete_filter_rule()

Description

Delete specified filter_rule

Parameters

ColumnTypeDefaultDescription
$filter_rule
$filter int - ID of filter_rule

Return

boolean | integer - false, or ID of filter_rule

Location

include/search_functions.php lines 2662 to 2675

Definition

 
function delete_filter_rule($filter_rule)
    {
    if(!
is_numeric($filter_rule))
            {
            return 
false;    
            }
            
    
// Delete and cleanup any unused nodes
    
sql_query("DELETE FROM filter_rule WHERE ref='$filter_rule'");  
    
sql_query("DELETE FROM filter_rule_node WHERE filter_rule NOT IN (SELECT ref FROM filter_rule)");
    
sql_query("DELETE FROM filter_rule WHERE ref NOT IN (SELECT DISTINCT filter_rule FROM filter_rule_node)"); 
        
    return 
true;
    }

This article was last updated 23rd November 2020 17:05 Europe/London time based on the source file dated 19th November 2020 14:20 Europe/London time.