WordPress.org

Forums

Events Manager
[resolved] Past events pages not being deleted (4 posts)

  1. melanie71
    Member
    Posted 2 years ago #

    I am having a problem with past events - once the event is finished it is disappearing from the events list, however the page actually still exists. An example is this - http://www.visitwollombi.com.au/events/sculpture-in-the-vineyards/ This event is finished so I don't want it to be available - I thought that once events were completed this page would automatically be deleted. How do I delete the pages for past events??

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

    currently, it's not deleted automatically for archiving purposes however try to hook into em_content or the_content filter and add some condition that will check the event date then restrict access if past events.

    for reference only: this filter is located at em-events.php
    http://wp-events-plugin.com/documentation/
    http://wp-events-plugin.com/tutorials/

    http://codex.wordpress.org/Plugin_API

  3. melanie71
    Member
    Posted 2 years ago #

    Thanks for your reply. Am I assuming that if I make this type of change every time I update Events Manager this change will be undone?? Also, are you able to provide a bit more info about how I actually make this change? Are you able to provide specific code I need to insert somewhere? Thanks in advance.

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    you'd need to create this code yourself, but here's some lines that would get the info you want:

    $events = EM_Event::get(array('scope'=>'past');
    EM_Event->delete($events);

    chances are you'll want to create a daily cron job using WP Cron, which executes these two lines. Search "WP Cron" on google for tutorials on doing that.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic