/** * use_filterable_display_order * * @access protected * @return string */ protected static function use_filterable_display_order() { // we need to first remove this callback from being applied to the_content() // (otherwise it will recurse and blow up the interweb) remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); remove_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1); //now add additional content depending on whether event is using the_excerpt() or the_content() EED_Events_Archive::_add_additional_excerpt_filters(); EED_Events_Archive::_add_additional_content_filters(); do_action('AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters'); // now load our template $content = EEH_Template::locate_template('content-espresso_events-details.php'); // re-add our main filters (or else the next event won't have them) add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); // but remove the other filters so that they don't get applied to the next post EED_Events_Archive::_remove_additional_events_archive_filters(); do_action('AHEE__EED_Events_Archive__use_filterable_display_order__after_remove_filters'); // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) //return ! empty( $template ) ? $template : $content; return $content; }
/** * event_details * * @access public * @param string $content * @return string */ public static function event_details($content) { global $post; $template = ''; if ($post->post_type == 'espresso_events' && !apply_filters('FHEE__EES_Espresso_Events__process_shortcode__true', FALSE) && !post_password_required()) { // we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb) remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); remove_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); //now add additional content depending on whether event is using the_excerpt() or the_content() EED_Events_Archive::_add_additional_excerpt_filters(); EED_Events_Archive::_add_additional_content_filters(); // now load our template $template = EEH_Template::locate_template('content-espresso_events-details.php'); // re-add our main filters (or else the next event won't have them) add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); // but remove the other filters so that they don't get applied to the next post EED_Events_Archive::_remove_additional_events_archive_filters(); } // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) return !empty($template) ? $template : $content; }