Title: PHP variables?
Last modified: August 20, 2016

---

# PHP variables?

 *  Resolved [eundas](https://wordpress.org/support/users/eundas/)
 * (@eundas)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/php-variables/)
 * 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.
 * [http://wordpress.org/extend/plugins/events-manager/](http://wordpress.org/extend/plugins/events-manager/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/php-variables/#post-3536454)
 * can I know where exactly you’ve wanted to add this? e.g. single events page? 
   or conditional placeholder might help you also? [http://wp-events-plugin.com/documentation/conditional-placeholders/](http://wp-events-plugin.com/documentation/conditional-placeholders/)
 * [http://wp-events-plugin.com/tutorials/](http://wp-events-plugin.com/tutorials/)
 *  Thread Starter [eundas](https://wordpress.org/support/users/eundas/)
 * (@eundas)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/php-variables/#post-3536455)
 * 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 (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/php-variables/#post-3536458)
 * 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.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=3550347)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [variables](https://wordpress.org/support/topic-tag/variables/)

 * 3 replies
 * 3 participants
 * Last reply from: [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/php-variables/#post-3536458)
 * Status: resolved