• I would like to study how Events Manager placeholders are built, but I do not know where the code is stored. Can you tell me the location of the file where the placeholders are defined?

Viewing 3 replies - 1 through 3 (of 3 total)
  • They’re a little scattered around ??

    Many of them are found here:
    /events-manager/templates/placeholders

    You’ll also find them in within the class files here:
    /events.manager/classes/

    This may also help too:
    https://wp-events-plugin.com/tutorials/create-a-custom-placeholder-for-event-formatting/

    Thread Starter sprinke

    (@sprinke)

    Thank you. I found the placeholder I was looking for in events-manager/classes/em-event.php.

    I would like to make a custom placeholder based on #_EVENTDATES which would be exactly the same as #_EVENTDATES but 22 days before the start date. This is the code for #_EVENTDATES:

    case '#_EVENTDATES':
    	//get format of time to show
    	$replace = $this->output_dates();
    	break;

    Could I do something like this?

    case '#_EVENTREGSTART':
    	//get format of time to show
    	$replace = $this->date_add(output_dates(),date_interval_create_from_date_string("-22 days"));
    	break;

    Also, I read the documentation on creating a custom placeholder, and also on where to add PHP code to WordPress, but these placeholders seem to depend on so much else around them that I don’t understand how to do it.

    • This reply was modified 7 years, 1 month ago by sprinke.

    I don’t think it’s going to work like that.

    I think you may be better off using strtotime to add + 22 days to $this->date_add(output_dates().

    https://php.net/manual/en/function.strtotime.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Where are placeholders’ is closed to new replies.