I'm attempting to intercept and filter items out of a class set array, $this->_vars, in a stripped down version of Smarty (not my choice :| )
Here's what I've been attempting to use:
Class callback function
private function callback_check($var){
if(!in_array($var['link_id'], $this->returned_array['items'])) return false;
else return true;
}
And the array filter itself:
foreach($this->_vars['content']['documents'] as $group_key => $link_groups){
array_filter($this->_vars['content']['documents'][$group_key]['links'], array(&$this, "callback_check"));
}
Now it does appear to be detecting which ones are in the array and which aren't, as I replaced the returns with prints to check. However, nothing is being removed from the array. Is there any way to do what I'm attempting, or have I missed something obvious?