Collections functions
Encryption functions
General functions
Theme permission 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 2615 to 2628

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 12th July 2020 08:35 Europe/London time based on the source file dated 7th July 2020 15:22 Europe/London time.