[EventCalendar] Alternatives to the_content filter?

Darrell Schulte d at schulte.mn
Wed Sep 20 00:19:55 UTC 2006


On Sep 19, 2006, at 6:35 PM, Jesse Planck wrote:

> Thought I would just send this to start a new thread based on Alex's
> recent message.
>
> I dug around for this and it is quite a pickle. There doesn't seem to
> be a good way to test for post attributes from the_content filter.
> Also really easy to hit conflicts with tons of other plugins there.
> Here are some thoughts.
>
> 1. the_posts filter (I think I have that right), but boy that could be
> a performance hit reparsing that whole array/object.
>
> 2. A separate function. Something that you could add to the "Loop" in
> your themes. That might work and keep us out of trouble if documented.
> Also could make styling a little more theme dependent.

Nice Jess...how about this:

Basically, add an option called $ec3->show_event_dates. If equal to  
1, show the events in the post -- if not, just show the regular  
$post_content. I implemented this in my usage of EC3 -- I had to  
circumvent a problem with the Subscribe2 widget.

function ec3_filter_the_content(&$post_content)
{
         global $ec3;
         if ($ec3->show_event_dates == 1) {
                 return ec3_get_schedule() . $post_content;
         } else {
                 return $post_content;
         }
}


I wonder if it would be useful per post instead of universally...I  
dunno.

Darrell

Darrell Schulte
http://schulte.mn





More information about the EventCalendar mailing list