/** * filter() * * @param array $anchor * @return anchor $anchor **/ function filter($anchor) { if (preg_match("/\\.(?:jpe?g|gif|png)\\b/i", $anchor['attr']['href'])) { return auto_thickbox::image($anchor); } elseif (!empty($anchor['attr']['class']) && in_array('thickbox', $anchor['attr']['class'])) { return auto_thickbox::iframe($anchor); } else { return $anchor; } }
/** * filter() * * @param array $anchor * @return anchor $anchor **/ function filter($anchor) { if (preg_match("/\\.(?:jpe?g|gif|png|bmp|webp)\\b/i", $anchor['attr']['href'])) { return auto_thickbox::image($anchor); } elseif (!empty($anchor['attr']['class']) && in_array('thickbox', $anchor['attr']['class'])) { return auto_thickbox::iframe($anchor); } elseif (strpos($anchor['attr']['href'], 'TB_iframe') !== false || strpos($anchor['attr']['href'], '#TB_inline') !== false) { return $this->add_thickbox_class($anchor); } else { return $anchor; } }