Support » Plugin: Events Manager » PHP variables?

  • Resolved eundas


    Is it possible to use the plugin variables? I’d like to include in my events a small snippet of PHP code that will display a piece of text if the date of the event matches certain date but not otherwise. If I had a variable storing the date of the event this would be pretty easy but I browsed the documentation and was unable to find a reference explaining how to do this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • can I know where exactly you’ve wanted to add this? e.g. single events page? or conditional placeholder might help you also?

    Conditional placeholders don’t work because they invoke some function which produces some output but they don’t contain the output themselves. Eventually I stayed awake for most of the night and solved the problem 🙂 For the record, I found that it is possible to do something like this:

    [Start example]
    global $post;
    $EM_Event = em_get_event($post->ID, ‘post_id’);
    $nmonth = date(‘m’,$EM_Event->start);
    [End example]

    In this example what I’m getting is the date of the event for the current event being displayed. This is (third line) formatted so that $nmonth will contain the numerical identifier of the month (January=1, February=2, etc.). With this variable I can solve my problem. I guess this is pretty basic but may help somebody else.

    Plugin Author Marcus


    yes, this is perfectly fine to do!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP variables?’ is closed to new replies.