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_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 3188 to 3201

Definition

 
function delete_filter_rule($filter_rule)
    {
    if(!
is_numeric($filter_rule))
            {
            return 
false;
            }

    
// Delete and cleanup any unused nodes
    
ps_query("DELETE FROM filter_rule WHERE ref=?", array("i",$filter_rule));
    
ps_query("DELETE FROM filter_rule_node WHERE filter_rule NOT IN (SELECT ref FROM filter_rule)");
    
ps_query("DELETE FROM filter_rule WHERE ref NOT IN (SELECT DISTINCT filter_rule FROM filter_rule_node)");

    return 
true;
    }

This article was last updated 4th December 2024 08:35 Europe/London time based on the source file dated 27th November 2024 09:40 Europe/London time.