Esempio n. 1
0
 /**
  * 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;
     }
 }
 /**
  * Access this plugin’s working instance
  *
  * @wp-hook plugins_loaded
  * @return  object of this class
  */
 public static function get_instance()
 {
     NULL === self::$instance and self::$instance = new self();
     return self::$instance;
 }