/** * get_the_excerpt - kinda hacky, but if a theme is using get_the_excerpt(), then we need to remove our filters on the_content() * * @access public * @param string $excerpt * @return string */ public static function get_the_excerpt($excerpt = '') { if (post_password_required()) { return $excerpt; } remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); return EED_Events_Archive::event_details($excerpt); }
/** * get_the_excerpt - kinda hacky, but if a theme is using get_the_excerpt(), then we need to remove our filters on the_content() * * @access public * @param string $excerpt * @return string */ public static function get_the_excerpt($excerpt = '') { if (post_password_required()) { return $excerpt; } if (apply_filters('FHEE__EED_Events_Archive__get_the_excerpt__theme_uses_get_the_excerpt', false)) { remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); $excerpt = EED_Events_Archive::event_details($excerpt); } else { EED_Events_Archive::$using_get_the_excerpt = true; add_filter('wp_trim_excerpt', array('EED_Events_Archive', 'end_get_the_excerpt'), 999, 1); } return $excerpt; }
/** * get_the_excerpt - kinda hacky, but if a theme is using get_the_excerpt(), then we need to remove our filters on the_content() * * @access public * @param string $excerpt * @return string */ public static function get_the_excerpt($excerpt = '') { remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); return EED_Events_Archive::event_details($excerpt); }